Search code examples
facebookfacebook-graph-apifacebook-ads-apifacebook-marketing-api

Facebook API: How to get the conversion pixel values for an ad


How can I read the values for a conversion pixel via Facebook API v2.4?

From what I read (and tried) you can't get it via the Insights API and the Reporting API is deprecated.

I want to read the following values:

  • actions_28d_click:offsite_conversion.checkout - Checkouts (Conversion Pixel) [28 Days After Clicking]
  • actions_28d_view:offsite_conversion.checkout - Checkouts (Conversion Pixel) [28 Days After Viewing]
  • actions_28d_click:offsite_conversion.registration - Registrations (Conversion Pixel) [28 Days After Clicking]
  • actions_28d_view:offsite_conversion.registration - Registrations (Conversion Pixel) [28 Days After Viewing]

Solution

  • Probably this might help you: https://www.facebookmarketingdevelopers.com/samples/adsreporting

    You need to query the Insights-API. That sample script above is retrieving values for the "28d-click"-attribution window. You need to change or extend the if-clause and the params-dict accordingly.