daroczig / fbRads

Analyze and manage Facebook ads from R using this client library to access their Marketing APIs
GNU Affero General Public License v3.0
151 stars 57 forks source link

Can't get all the data with fb_insights #119

Closed diegocgaona closed 4 years ago

diegocgaona commented 4 years ago

Hi,

I didn't used the package for sometime and the Facebook Marketing API changed a lot.

I'm trying to get data from my campaigns, but I receive only a dataframe with three columns. Two columns of start and end date and one column of a field I asked, but only one field, not all I listed.

I'm doing this way: l <- fb_insights(date_preset = 'last_month', level = 'campaign', fields = c('campaign_id','campaign_name','unique_clicks','impressions','objective'))

I this case I receive a list with one dataframe with the date columns and the objective column. I always receive only the data from the last field I put in the fields parameter.

The data I receive are like the example bellow:

+-----------------+------------+------------+
|    objective    | date_start | date_stop  |
+-----------------+------------+------------+
| BRAND_AWARENESS | 2019-09-01 | 2019-09-30 |
+-----------------+------------+------------+

I tried the example from the help and doesn't work too.

I'm using the API 4.0 and fbrads 0.2

What I am doing wrong? Can you help me?

Thanks!!

daroczig commented 4 years ago

Thanks for the report! Seems like a bug that has been around for a while .. that I did not bump into as not really using the Insights API on a single (Ad Account) target. Just pushed a fix, please install from master and report back how it works.

diegocgaona commented 4 years ago

Hi @daroczig,

Thank you very much!! I installed the master and it worked fine! (like before)

Best regards, Diego