3

I've created a Facebook app, linked it with a business, submitted and passed review, the business is verified, contracts signed, the app has leads_retrieval permission, the app status is now live.

I can test it under the webhooks link in the side menu, my end point receives the test data from Facebook. The data shown below is received by my server.

Test leadgen screen shot

When I test using the lead ads testing tool I instantly get a 102, server error, and nothing is received by my server. See below for the message.

Lead ads testing tool screen shot

I've spent so long getting to this stage and every step has been painful!

Can anyone suggest why using the lead ads testing tool results in an error and what I can do to resolve the issue.

Cheers

Steve
  • 1,523
  • 10
  • 24
  • _“ and nothing is received by my server”_ - how exactly did you verify/determine that? By checking the actual access log, or …? – 04FS Jul 03 '19 at 10:52
  • My endpoint currently writes the data to a log file. Nothing gets written to the log file. – Steve Jul 03 '19 at 11:04
  • That does not necessarily mean that your server did not receive the request to begin with. (Not saying that it wasn’t the case, but when trying to debug such issues, it pays off to be precise in what you are checking, and to not draw unwarranted conclusions.) – 04FS Jul 03 '19 at 11:06
  • If the endpoint is called it writes to the log file, every time, regardless of what it receives. It's not writing anything to the log file when the lead ads testing tool shows a 102 error. – Steve Jul 03 '19 at 11:16
  • 1
    Hello Steve. Did you manage to solve this issue ? I'm having the same problem =S. Any help will be very appreciated – Ayorus Jan 13 '21 at 18:47

3 Answers3

1

I've been struggling with this too.. Apparently you can't use it on development apps anymore. Found the answer here: https://stackoverflow.com/a/57397525/8439792

lelbil
  • 118
  • 5
1

I think I found your problem! It is when you subscribe to your apps. Here is the link that shows the subscribed_fields and scope should be:

https://stackoverflow.com/a/54713182/7313872

I was going straight from the demo and the subscribed_fields is set to 'feeds' and the scope was only manage_pages. You need to change it like in the example in the above link. I will also provide the snippets I changed below:

subscribed_fields - in subscribe apps function

FB.api(
  '/' + page_id + '/subscribed_apps',
  'post',
  {access_token: page_access_token, subscribed_fields: 'leadgen'},
  function(response) {
    console.log('Successfully subscribed page', response);
  }
);

scope - end of facebook login function

{scope: ['manage_pages', 'leads_retrieval']});

Hope this helps!

Nick
  • 11
  • 1
0

Facebook had the problem in their startup documentation for the webhooks. I have notified them in a bug, and does look like they have fixed the documentation to now subscribe to "leadgen" and not "feeds".

https://developers.facebook.com/support/bugs/681262475926363/

https://developers.facebook.com/docs/marketing-api/guides/lead-ads/quickstart/webhooks-integration/

Jack
  • 1