Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

fb_insights only fetches last breakdown value #133

Open
hhissami opened this issue Nov 12, 2020 · 1 comment
Open

fb_insights only fetches last breakdown value #133

hhissami opened this issue Nov 12, 2020 · 1 comment

Comments

@hhissami
Copy link

Hi,

When multiple breakdown values get passed into fb_insights(), it only returns the last breakdown as a column in the resulting dataframe.

For example:

insights_list <- fb_insights(target=campaign_id, level="ad", date_preset = "lifetime", fields=c("ad_name"), breakdowns = c("gender", "age"))

returns a dataframe with the following columns:

$ ad_name  <chr>
$ date_start <chr>
$ date_stop  <chr>
$ age  <chr>

Note there is an age column but no gender column.

I tested this with other breakdown values, and the same pattern always holds where only the last breakdown value ends up as a column.

@sayac007
Copy link

Don't use "c(", note that your command is just converted into a URL which should be formatted according to Facebook guidelines, see here for examples: https://developers.facebook.com/docs/marketing-api/insights/breakdowns#combiningbreakdowns

In your case, simply use "breakdowns="gender, age"", without "c(".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants