Why does Facebook leadgen ads testing tool give a 102 server error?

Viewed 1022

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

3 Answers

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!

Related