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

Unable to pull ad account data #143

Open Datacove1 opened 3 years ago

Datacove1 commented 3 years ago

Hello,

I'm trying to pull ad account data into R, but it keeps either failing or timing out. This could be to do with an API issue (as I know Facebook are having some problems at the moment), but I'm not convinced because the error message says:

Error in fbad_request(path = url$path, method = "GET", params = url$params, : Unsupported get request. Object with ID 'vhttps:' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

Anonymised code below

fb_token <- "my_token"
Account <- fbad_init(accountid = "my_account", fb_token, version="10.0")

FB_raw <- fb_insights(level="ad",time_increment=1,date_preset="this_year",breakdowns="publisher_platform",
                      action_attribution_windows="28d_click,7d_view",
                      fields=toJSON(c("campaign_name","adset_name","ad_name","spend","impressions",
                                      "inline_link_clicks","actions","converted_product_value"))) %>%  do.call(rbind.data.frame,.)

This used to work fine with API v9.0, but today is the first time I've used it since that was deprecated - so wondering if it's version 10 that's actually causing the issue. Any help much appreciated.

Many thanks,

Jeremy