This R package includes wrapper functions around the Facebook Marketing API to create, read, update and delete custom audiences, images, campaigns, adsets, ads and related content.
For more details, see the slides presented at useR! 2015, the Los Angeles R Users Group and at a Domino Webinar.
To be able to use this package, you will have to create a Facebook App and authorize it to manage your Facebook ads. Basic steps to create an app with Development access level letting you manage up to 5 Facebook ad accounts:
Display Name
(eg "app_testing_foobar_42"), and provide your e-mail address. Click on "Create App ID" & pass the captcha test.Store your token in a secure place, and you are all set to start using fbRads
, eg list all the Ad Account ids you can access:
r
accounts <- fbad_get_my_ad_accounts(token)
Pick an Ad Account id from the returned list and initialize fbRads
to use that Ad Account by default:
r
account <- sample(accounts$account_id, 1)
fbad_init(accountid = account, token = token)
Then list all your ads along with the ad name and status on that Ad Account:
r
fbad_list_ad(fields = c('name', 'effective_status'))
Or eg filter for the active ads:
r
fbad_list_ad(statuses = 'ACTIVE', fields = 'name')
The package is actively maintained, but not frequently pushed to CRAN, so to use the most recent version, install from GitHub. The master
branch is supposed to include a relatively stable version at all the time:
devtools::install_github('daroczig/fbRads')
This package makes your life more convenient when it comes to interacting with the Facebook Marketing API, but unfortunately, it cannot save you the time to get familiar with the actual API endpoints. To be able to interact with Facebook, you have to learn about how the API works etc -- see the documentation at https://developers.facebook.com/docs/marketing-apis
This package was originally developed at CARD.com, then maintained at System1. If you are interested in taking over the maintenance of this R package, please open a GH ticket.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.