简体   繁体   中英

Testing Facebook Lead Ads Webhooks

I'm using Lead Ads and want to integrate them with my application. There is quite nice documentation for that, but I still don't know how to test webhooks. When I fill the form from the Preview Ad feature from Ads Manager , it doesn't seem to fire the webhook. Same happens with the testing feature, which is a call to /<APP_ID>/subscriptions_sample edge. According to docs, it should do the following:

This will deploy a stubbed payload similar to the one that the realtime updates uses.

But my callback URL is never opened with this, even though the response is:

{
  "success": true
}

How can I force this webhook to happen?

It's a bit tricky, but you can test in two ways:

  1. Simply by creating new lead ads in Power Editor and previewing them on mobile or desktop. You fill out the form with your own data. The downside to this is that you can only fill out a form once. Then you'll have to create a new form, switch your ad to use the new form and try again. You'll end up with a bunch of test forms since there is currently no way to delete forms.
  2. By making the call to //subscriptions_sample as you suggest yourself. This works somehow, but the lead will be empty. You'll get a leadgen-id which you can get lead data from, but there are no fields in the lead. If this doesn't work, you'll need to check a few things:

a) is your app subscribed to the page

b) is your webhook URL correct

c) are there any errors in your webhook URL

d) are you using a valid token

e) ...

Notice that tokens expire so you should change your token for a long-lived token which will be good for 60 days. I hope this will help you since it's not quite so easy to set up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM