grabCreatives: grabCreatives

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/grabCreatives.R

Description

Fetches URL(s) name(s) and more about creatives used in an ad.

Usage

1
2
grabCreatives(id, token, n = 100, fields = "default", verbose = FALSE,
  limit = 100)

Arguments

id

The id of the object you want to grab from (Required), see how to find yours.

token

A valid token as returned by fbAuthenticate or a short-term token from facebook Graph API Explorer.

n

Number of results to retrieve, defaults to 100. When you make an API request, you will usually not receive all of the results of that request in a single response. This is because some responses could contain thousands of objects so most responses are paginated by default.

fields

Defaults to default (id and name). See findFields

verbose

Defaults to FALSE if TRUE will print information on the queries in the console.

limit

Number of results requested at each API call, defaults to 100.

Details

Calls adcreatives.

Value

Returns IDs and URLs of all images contained in object (single row if ad.id is passed as arguement)

Author(s)

John Coene jcoenep@gmail.com

See Also

fbAuthenticate, listAccounts, grabAds

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# authenticate
fbOAuth <- fbAuthenticate(app.id = "1234567890123456", 
                          app.secret = "16xx79321xx0130x2x10a08x3e2x30xx", 
                          scope = "ads_management")
# get account ids
act <- listAccounts(id = "me", token = fbOAuth)

# get all creatives in ad account
img_acc <- listCreatives(id = act[2,2], token = fbOAuth)

# get campaigns, adsets and ads IDs from account
ads <- grabAds(account.id = act[2,2], token = token = fbOAuth)

# get ad creatives
crea_ad <- listCreatives(id = sample(ads$id, 1), token = fbOAuth)

## End(Not run)

JohnCoene/fbadsinsightsr documentation built on May 28, 2019, 12:55 p.m.