• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    R
  • License
    GNU Affero Genera...
  • Created over 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Analyze and manage Facebook ads from R using this client library to access their Marketing APIs

fbRads

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, EARL 2015, the Los Angeles R Users Group and at a Domino Webinar.

Creating a Facebook App & connect with OAuth token

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:

  1. Click on "Add a New App" at https://developers.facebook.com/apps

  2. Fill in a unique Display Name (eg "app_testing_foobar_42"), and provide your e-mail address. Click on "Create App ID" & pass the captcha test.

  3. Select the "Implement Marketing API" scenario that will automatically add the "Marketing API" to the "Products" section of the sidebar, or click on the "+" butting in the "Products" section of the sidebar

  4. Optionally associate your app with a Business Manager in the "Settings" screen of the "Marketing API"

  5. In the sidebar, select "Tools" from the "Marketing API" and generate a token

  6. 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:

    accounts <- fbad_get_my_ad_accounts(token)
  7. Pick an Ad Account id from the returned list and initialize fbRads to use that Ad Account by default:

    account <- sample(accounts$account_id, 1)
    fbad_init(accountid = account, token = token)
  8. Then list all your ads along with the ad name and status on that Ad Account:

    fbad_list_ad(fields = c('name', 'effective_status'))
  9. Or eg filter for the active ads:

    fbad_list_ad(statuses = 'ACTIVE', fields = 'name')

Development version

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')

Using the package

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, currently maintained at System1 -- licensed under AGPL-3.

More Repositories

1

logger

A lightweight, modern and flexible, log4j and futile.logger inspired logging utility for R
R
234
star
2

binancer

An R client to the Public Rest API for Binance.
R
54
star
3

Mastering-Data-Analysis-with-R

R code examples for my book
R
35
star
4

CEU-R-lab

Data Analysis 1a: Foundation of Data management in R @ CEU
R
32
star
5

dbr

Secure database connections and convenient queries from R on the top of DBI
R
30
star
6

botor

Reticulate wrapper on 'boto3' with convenient helper functions -- aka "boto fo(u)r R"
R
29
star
7

CEU-R-prod

R materials for the "Data Infrastructure in Production" class at CEU
22
star
8

CEU-DV2

Materials for the "Data Visualization 2" class at CEU
R
20
star
9

CEU-R-mastering

Materials for the "Mastering R" class at CEU
7
star
10

user2015-markdown-tutorial

Slides and example codes for my R Markdown tutorial at useR! 2015, Aalborg
HTML
7
star
11

within

R implementation of the most frequently used three-dimensional fixed effects panel data models the appropriate Within estimators.
R
4
star
12

AWR.Kinesis

Amazon Kinesis Consumer Application from R for Stream Processing
R
4
star
13

singR

helper functions to "sing" songs with R
R
4
star
14

CEU-R-skills

R Skills class @ CEU
R
3
star
15

migration.indices

Migration indices
R
3
star
16

saves

An R package for fast loading specified variables from binary files
R
3
star
17

AWR.Snowflake

Snowflake JDBC DBI Wrapper for R
R
3
star
18

CEU-use-case-seminars

Invited talks on using R for Data Science from industry experts
3
star
19

AWR.KMS

A Simple Client to the AWS Key Management Service
R
3
star
20

daroczig.github.io

Personal homepage
HTML
2
star
21

CEU-DV4

Materials for the "Data Visualization 4" class at CEU
R
2
star
22

CEU-R-1-demos-group2

Rebol
2
star
23

kineRic

DEPRECATED, use AWR.Kinesis instead
R
2
star
24

fbRads-transition

This WAS a temporarily repo while migrating https://github.com/daroczig/fbRads from cardcorp org -- DON'T USE THIS! Soon to be deleted.
R
2
star
25

CEU-DA1-2018-seminar-homeworks

Shell
1
star
26

PWA

Pulse Wave Analysis in R
R
1
star