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

Commit e701f96

Browse files
authored
Merge pull request #91 from daroczig/v2.11
V2.11
2 parents 16ba702 + 73904b2 commit e701f96

10 files changed

+210
-17
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Title: Analyzing and Managing Facebook Ads from R
77
Description: Wrapper functions around the Facebook Marketing 'API' to create,
88
read, update and delete custom audiences, images, campaigns, ad sets, ads and
99
related content.
10-
Version: 2.10.0
11-
Date: 2017-11-01
10+
Version: 2.11.0
11+
Date: 2018-04-28
1212
URL: https://github.com/daroczig/fbRads
1313
License: AGPL-3
1414
Imports:

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export(fbad_create_lookalike_audience)
1515
export(fbad_delete_audience)
1616
export(fbad_get_adaccount_details)
1717
export(fbad_get_adaccounts)
18+
export(fbad_get_client_ad_accounts)
19+
export(fbad_get_client_pages)
20+
export(fbad_get_owned_ad_accounts)
21+
export(fbad_get_owned_pages)
1822
export(fbad_get_pixels)
1923
export(fbad_get_search)
2024
export(fbad_init)

NEWS

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
1+
fbRads 2.11.0 (2018-04-28)
2+
----------------------------------------------------------------
3+
4+
Add support for Facebook Marketing API v2.11
5+
6+
* get Pages and Ad Accounts of the clients of a Business Ad Account
7+
8+
Fixes:
9+
10+
* more standardized simplify argument when listing / reading Facebook objects
11+
* RCurl issues with Unicode characaters
12+
* further retries on (temporarily) SSL and network errors
13+
14+
fbRads 2.10.0 (2017-11-01)
15+
----------------------------------------------------------------
16+
17+
Add support for Facebook Marketing API v2.10
18+
19+
Fixes:
20+
21+
* further retries on (temporarily) SSL and network errors
22+
* improved malformed JSON parsing
23+
* improved paging of API results
24+
25+
fbRads 2.9.0 (2017-07-21)
26+
----------------------------------------------------------------
27+
28+
Add support for Facebook Marketing API v2.9:
29+
30+
Fixes:
31+
32+
* paging when listing all Ad Accounts on a Business Account
33+
* look-up pixels
34+
* simplify argument improvements
35+
* doc tweaks on how to generated a token
36+
37+
fbRads 0.2 (2017-04-18)
38+
----------------------------------------------------------------
39+
40+
Add support for Facebook Marketing API v2.8: #51
41+
42+
Fixes:
43+
44+
* remove line-breaks in malformed JSON returned by Facebook
45+
* simplify argument introduced for listing and reading Facebook objects
46+
47+
fbRads 0.2 (2016-10-12)
48+
----------------------------------------------------------------
49+
50+
Add support for Facebook Marketing API v2.7: #36
51+
52+
* subtype for custom & lookalike audiences
53+
* business_management scope needed to manage ads
54+
55+
Fixes:
56+
57+
* return actual error message from Facebook
58+
* always retry failed sync Insights API requests as async
59+
60+
fbRads 0.2 (2016-07-27)
61+
----------------------------------------------------------------
62+
63+
Add support for Facebook Marketing API v2.6: #25
64+
65+
Fixes:
66+
67+
* timeout async queries after 45 mins
68+
* further retries on (temporarily) SSL and network errors
69+
170
fbRads 0.2 (2016-04-04)
271
----------------------------------------------------------------
372

R/fb_init.R

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Returns the most recent version of the supported Facebook Marketing API
22
#' @return string
33
#' @export
4-
fb_api_most_recent_version <- function() '2.10'
4+
fb_api_most_recent_version <- function() '2.11'
55

66
#' Returns the currently used version of the Facebook Marketing API
77
#' @return string
@@ -332,16 +332,16 @@ fbad_request_next_page <- function(url) {
332332
fromJSONish(res)
333333
}
334334

335-
#' Get account details belonging to eg an Ad or Business Manager Account
336-
#' @references \url{https://developers.facebook.com/docs/marketing-api/reference/ad-account#Reading}
335+
#' Get account details of Ad Accounts owned by a Business Manager Account
336+
#' @references \url{https://developers.facebook.com/docs/marketing-api/businessmanager/assets#adaccounts}
337337
#' @param id Facebook Object, eg Ad Account (with \code{act} prefix) or a Business Manager Account ID
338338
#' @param token FB Ads API token (if running before \code{fb_init})
339339
#' @param version Facebook Marketing API version (if running before \code{fb_init})
340340
#' @param fields character vector
341341
#' @param simplify return \code{data.frame} or \code{list}
342342
#' @return list(s) containing account details
343343
#' @export
344-
fbad_get_adaccounts <- function(id, token, version, fields = c('name'), simplify = TRUE) {
344+
fbad_get_owned_ad_accounts <- function(id, token, version, fields = c('name'), simplify = TRUE) {
345345

346346
## look up function name to know what API endpoint to use
347347
fn <- deparse(match.call()[[1]])
@@ -363,7 +363,11 @@ fbad_get_adaccounts <- function(id, token, version, fields = c('name'), simplify
363363

364364
res <- fromJSONish(fbad_request(
365365
path = file.path(id, switch(fn,
366+
'fbad_get_client_ad_accounts' = 'client_ad_accounts',
367+
'fbad_get_owned_ad_accounts' = 'owned_ad_accounts',
366368
'fbad_get_adaccounts' = 'owned_ad_accounts',
369+
'fbad_get_client_pages' = 'client_pages',
370+
'fbad_get_owned_pages' = 'owned_pages',
367371
'fbad_get_pixels' = 'adspixels')),
368372
method = 'GET',
369373
params = list(
@@ -388,15 +392,39 @@ fbad_get_adaccounts <- function(id, token, version, fields = c('name'), simplify
388392
}
389393

390394

395+
#' Get account details of Ad Accounts belonging to the clients of a Business Manager Account
396+
#' @inheritParams fbad_get_owned_ad_accounts
397+
#' @export
398+
fbad_get_client_ad_accounts <- fbad_get_owned_ad_accounts
399+
400+
401+
#' Deprecated in favor of \code{fbad_get_owned_adaccounts}
402+
#' @inheritParams fbad_get_owned_ad_accounts
403+
#' @export
404+
fbad_get_adaccounts <- fbad_get_owned_ad_accounts
405+
406+
407+
#' Get account details of Pages belonging to the clients of a Business Manager Account
408+
#' @inheritParams fbad_get_owned_ad_accounts
409+
#' @export
410+
fbad_get_client_pages <- fbad_get_owned_ad_accounts
411+
412+
413+
#' Get account details of Pages owned by a Business Manager Account
414+
#' @inheritParams fbad_get_owned_ad_accounts
415+
#' @export
416+
fbad_get_owned_pages <- fbad_get_owned_ad_accounts
417+
418+
391419
#' Get tracking pixels of eg an Ad or Business Manager Account
392420
#' @references \url{https://developers.facebook.com/docs/marketing-api/reference/ads-pixel/#Reading}
393-
#' @inheritParams fbad_get_adaccounts
421+
#' @inheritParams fbad_get_owned_ad_accounts
394422
#' @param token FB Ads API token
395423
#' @param version Facebook Marketing API version
396424
#' @param fields character vector
397425
#' @return list(s) containing Ads Pixels
398426
#' @export
399-
fbad_get_pixels <- fbad_get_adaccounts
427+
fbad_get_pixels <- fbad_get_owned_ad_accounts
400428

401429

402430
#' Initiate Facebook Account with OAuth token

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To be able to use this package, you will have to create a Facebook App and autho
2828
7. Please note the above last step: we store the token as a string. Now you can save that token in a safe place and start using `fbRads`, eg:
2929

3030
```r
31-
fbad_init(accountid = accountid, token = tkn, version = '2.10')
31+
fbad_init(accountid = accountid, token = tkn, version = '2.11')
3232
```
3333

3434
8. And list all your ads along with the ad name and status or eg filter for the active ads:

man/fbad_get_adaccounts.Rd

Lines changed: 2 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fbad_get_client_ad_accounts.Rd

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fbad_get_client_pages.Rd

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fbad_get_owned_ad_accounts.Rd

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fbad_get_owned_pages.Rd

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)