Skip to content

Instantly share code, notes, and snippets.

@g-k
Last active August 29, 2015 14:09
Show Gist options
  • Save g-k/e9ced567cdb70762f75b to your computer and use it in GitHub Desktop.
Save g-k/e9ced567cdb70762f75b to your computer and use it in GitHub Desktop.

Facebook Ad Insights v2.2 API Notes

Ad Report Stats (URL ends with: /reportstats despite its name)

Breakdown columns

Data breakdown columns cannot be used together except for few exceptions. See the table for allowed combinations.

  • Cannot fetch: country and age or country and gender

  • Can fetch: age and gender (but not age,gender because that's not a column name)

  • Cannot fetch spend columns with breakdowns (however error not thrown)

  • Age and gender or country can be fetched with action columns, but including action_target_name causes no data to be returned.

https://developers.facebook.com/docs/reference/ads-api/adreportstats/v2.2#columns

Placement and Cross device columns
  • Include both placement and impression device columns (however, these two columns have different time range restrictions see below)
  • Cannot fetch these columns with age and gender or country breakdown columns
Time restrictions

The API can't provide some data before certain dates:

  • any data prior to September 28th 2012,
  • actions prior to November 15th 2012,
  • demographic data (gender, age) prior to Jan 1st 2013,
  • placement data prior to April 24th 2013.
  • impression_device and action_device data prior to July 3rd 2014

https://developers.facebook.com/docs/reference/ads-api/adreportstats/v2.2#restrictions

Immediately fetching (say within <5ms) an Ad Report Stats report after the export says 100% complete can return incomplete data (workaround wait 100ms).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment