I have configured webhooks in my Facebook App to send leadgen
data to my web application. It works fine for the most part and I receive the webhooks in real time but the the fields adgroup_id
and ad_id
are not present in the response object as it should be according to the documentation.
This is one example of the leadgen webhooks I receive:
{
"entry": [
{
"id": "105329XXXXXXXXX",
"time": 1679056584,
"changes": [
{
"value": {
"created_time": 1679056582,
"leadgen_id": "89738XXXXXXXXX",
"page_id": "105329XXXXXXXXX",
"form_id": "580189XXXXXXXXX"
},
"field": "leadgen"
}
]
}
],
"object": "page"
}
I need these fields to be able to fetch the Facebook campaign that these leads belong to.
When I access the leadgen data making the following request: https://graph.facebook.com/v16.0/{leadgen_id} It does not included the ad_id
or campaign_id
either.
If I add field params in the request: https://graph.facebook.com/v16.0/{leadgen_id}?fields=ad_id,campaign_id. I only receive the leadgen_id
. It is worth mentioning that when I make this request on the Graph Api Explorer and hover over the selected fields (ad_id,campaign_id), it shows the following message:
Field is empty or disallowed by the access token
The fields can't be empty because there is an ad_id
and campaign_id
related to that lead. But I still don't understand what permission I am missing if that is the case.
The app is in Live Mode and its App type is None.
We have been approved as Tech Provider by Facebook and have Business Verification.
Facebook login is implemented through a custom oauth flow that requests the following permissions since these are the ones the documentation requires:
leads_retrieval
ads_management
pages_show_list
pages_manage_metadata
pages_read_engagement
pages_manage_ads
All of these permissions have been approved by App Review and have Advanced Access.
Only the page leadgen
webhook is subscribed.
The Ads API access level is development.
I suspected it is a permissions issue. So we tested it adding the ads_read
permission but it still did not work. The app review to get the advanced access to this permission was rejected because Facebook said that the permission is not needed for the feature.
Then I thought it may be because of the Ads API access (development). I tried to request an app review to get advanced access to Ads Management Standard Access
but I can not do it since I have not made at least 1500 requests to the related endpoints.
What is the cause of the leadgen webhooks missing the ad_id
and adgroup_id
fields?. Or the leadgen response missing the ad_id
and campaign_id
?
The problem is that leads created using the Lead Ads Testing tool never include the ad_id
or adgroup_id
. Neither do the leads created by clicking on an ad shared via shareable link. Only real leads generated by real users clicking on the live ad include this info in the leadgen webhook payload.
This is a bummer since the Sandbox Ad Account Management tools are "temporary" disabled and the only way to test this is by publishing a real ad and receiving real leads. This makes the development process much more difficult.
Meta should really address this.