updateAdset: Update adset

Description Usage Arguments Value Author(s) Examples

View source: R/updateAdset.R

Description

Update a specific adset

Usage

1
updateAdset(id, settings, token)

Arguments

id

ID of object to update.

settings

list of settings to update

token

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

Value

Boolean, success TRUE or FALSE

Author(s)

John Coene jcoenep@gmail.com

Examples

 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
TK <- fbAuthenticate(app.id = "1234567890123456", 
                     app.secret = "16xx79321xx0130x2x10a08x3e2x80xx")
                     
# get 100 accounts users (me) has access to
accounts <- listAccounts("me", TK)

ids <- createLabels(accs$id[1], labels = "my label", token = TK)

adset_ids <- grabAdsets(accs$id[1], TK) # retrieve adsets

# collapse ids
ids <- paste0("'", paste0(ids, collapse = "', '"), "'")
                  
# create settings to update - ad label                   
my_settings <- list(adlabels = paste0("[{id:", ids,"}]")) 

updateAdset(adset_ids[1], my_settings, TK)

## End(Not run)

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