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

how to use fb_insights function to import data from facebook using R #18

Closed
simran-k opened this issue Jun 15, 2016 · 1 comment
Closed

Comments

@simran-k
Copy link

I am trying to use fbRads library to import data from facebook using R.

https://cran.r-project.org/web/packages/fbRads/fbRads.pdf

I have a valid fbaccount object returned by fb_init function and then I am trying to use exactly the same example mentioned here in the docs:

l <- fb_insights(fbacc, date_preset = 'today', level = 'ad')
library(rlist)
list.stack(list.select(l, date_start, date_stop, ad_id, total_actions,
total_unique_actions, total_action_value, impressions, unique_impressions,
social_impressions, unique_social_impressions, clicks, unique_clicks,
social_clicks, unique_social_clicks, spend, frequency, deeplink_clicks,
app_store_clicks, website_clicks, reach, social_reach, ctr, unique_ctr,
cpc, cpm, cpp, cost_per_total_action, cost_per_unique_click,
relevance_score = relevance_score$score))

In variable l, I get:

>print(l)
[[1]]
list()
and then

>list.stack(list.select(l, date_start, date_stop, ad_id, total_actions,
+                        total_unique_actions, total_action_value, impression .... [TRUNCATED] 
Error in eval(expr, envir, enclos) : object 'date_start' not found

What seems to be not working here? How do I fix this?

@daroczig
Copy link
Owner

daroczig commented Jul 27, 2016

The empty l suggests that there are no running ads (or spend) today, so there's nothing to report on. Try with a wider date_preset (eg for the past 7 days) or make sure you have data before running the rest of the example script.

Please let me know if it helps or reopen if you need any more hints here or if you think it's a bug in the package.

This issue was closed.
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