getLabAds: Get ads by labels

Description Usage Arguments Author(s) See Also Examples

View source: R/getLabAds.R

Description

Retrieves ads by labels under given account.

Usage

1
2
getLabAds(account.id, labels, fields = c("id", "name"), operator = "ANY",
  token, n = 100, verbose = FALSE)

Arguments

account.id

ID of the account to retrieve labels from.

labels

IDs of labels to retrieve.

fields

Fields (variables) to retrieve, see findFields for valid values, defaults to id and name.

operator

Matching operator either ALL or ANY, defaults to ANY

token

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

n

Number of results to return

verbose

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

Author(s)

John Coene jcoenep@gmail.com

See Also

listLabels

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# run authentication with your app details
TK <- fbAuthenticate(app.id = "1234567890123456", 
                     app.secret = "16xx79321xx0130x2x10a08x3e2x80xx")

# get all accounts users (me) has access to
accounts <- listAccounts("me", TK, n = 999999)

set.seed(19880525) # set seed for sample() reproducability

# get labels of random account
labs <- listLabels(account.id = sample(accounts$id, 1), token = TK)

# get ads by labels - 2 selected at random
ads <- listLabAds(sample(accounts$id, 1), labels = sample(labs$id, 2), 
                  token = TK)

## End(Not run)

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