Description Usage Arguments Details Author(s) See Also Examples
Get insights on advertising performances of an ad. See documentation for more information
1 2 3 4 | getCampaign(campaign.id, token, fields = "default", n = 100,
action.attribution.windows, action.breakdowns, action.report.time, breakdowns,
date.preset, level, time.increment, time.range, summary = FALSE,
verbose = FALSE, limit = 100)
|
campaign.id |
The id of the campaign you want to retrieve insights about (Required), see how to find yours. how to find yours. |
token |
A valid token as returned by |
fields |
There are in total 73 valid fields defaults to
( |
n |
Number of results to retrieve, defaults to |
action.attribution.windows |
Determines what is the attribution window for the actions.
For example, |
action.breakdowns |
How to break down action results. Supports more than one breakdowns
(Optional). Run |
action.report.time |
Determines the report time of action stats.
For example, if a person saw the ad on Jan 1st but converted on Jan 2nd,
when you query the API with |
breakdowns |
How to break down the result. Does not support more than one breakdown,
except |
date.preset |
Represents a relative time range (Optional). This field is ignored if
|
level |
Represents the level of result (Optional). Must be one of |
time.increment |
If it is an integer, it is the number of days from 1 to 90.
After you pick a reporting period by using |
time.range |
time range must be |
summary |
Default value: false Determine whether to return a summary section with the same fields as specified by fields will be included in the summary section. |
verbose |
Defaults to |
limit |
Number of results requested at each API call, defaults to 100.
Sometimes useful to bring it down if many results ( |
This function refers to the following API call
https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights/,
it is strongly encouraged to have a look a the latter link.
only the following parameters are not available default_summary
,
filtering
,
summary
, sort
and time_ranges
.
John Coene jcoenep@gmail.com
fbAuthenticate
, link{findParams}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# run authentication with your app details
fbOAuth <- fbAuthenticate(app.id = "1234567890123456",
app.secret = "76xx79121xx0130x2x10a08x3e2x80xx",
scope = "ads_management")
# get information on account
info <- findInfo(account.id = "act_123456789012345", token = fbOAuth)
# take random ad.id
set.seed(123)
rand_id <- sample(info$campaigns$id, 1)
# get date.preset
date <- findParams("date.preset")[grep("quarter", findParams("date.preset"))]
# fetch Ad data for this quarter
data <- getCampaign(campaign.id = rand_id, token = fbOAuth,
date.preset = date)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.