Skip to content

Instantly share code, notes, and snippets.

View zspotter's full-sized avatar
🎨

Zach Potter zspotter

🎨
View GitHub Profile
@zspotter
zspotter / gist.md
Created August 27, 2020 19:28
Scraping FB Ads metrics and breakdowns

Some notes on using the FB Marketing Insights API to build a dashboard similar to Facebook Ads Manager Reporting --

The API docs appear very thorough, but are missing an exhaustive list of fields that you'd need to build a generic reporting tool. In my first attempt, I pulled all fields from these docs, but found a lot of discrepencies when compared to FB's UI.

It's more productive to scrape the visible options from FB's own UI, which can be done like this:

  • Visit Facebook Ads Manager Reporting and open the report builder
  • Select the Breakdowns tab
  • Use this nasty JS snippet in the dev console