if (FALSE) {
fb_insights(fbacc)
## get default fields and filter for a few metrics
l <- fb_insights(date_preset = 'today', level = 'ad')
## merge pages into tabular data
data.table::rbindlist(l)
## sometimes more advanced list selections are needed
l <- fb_insights(date_preset = 'today', level = 'ad', fields = 'unique_actions', simplify = FALSE)
## filter for ACTIVE Ads
l <- fb_insights(date_preset = 'today', level = 'ad',
filtering = "[{'field':'adset.effective_status','operator':'IN','value':['ACTIVE']}]")
}
Run the code above in your browser using DataLab