faceGetAdId: Get Facebook Ad Ids

Description Usage Arguments Value

Description

This function is useful to get a brief overview of the ads.

This function requires that you set up an app on Facebook, and that you have access to the appropriate adAccount. Customers should give you access to your personal Facebook account. They can do it through business.facebook.com. Video about what the api does: https://www.facebook.com/marketingdevelopers/videos/772240782890323/ Video about using the marketing api: https://www.facebook.com/marketingdevelopers/videos/772232066224528/ Great explanation of how to get started, and on which I found the syntax it on github: https://github.com/cardcorp/fbRads To get an api key, you need to get the appId, appSecret, and adAccount number. Once you get those three things, you can get the access token in the following way: fb_app <- oauth_app(appname = "facebook", key = appId, secret = appSecret) # Define the app creds <- oauth2.0_token(oauth_endpoints("facebook"), fb_app, scope = 'public_profile' , type = 'application/x-www-form-urlencoded', cache = T) accessToken <- creds$credentials Breakdowns: https://developers.facebook.com/docs/marketing-api/insights/parameters

Depends on tidyverse, lubridate, magrittr, httr, jsonlite.

Usage

1
faceGetAdId(adAccount, accessToken, sinceDate, untilDate, verbose = T)

Arguments

adAccount

The quoted adAccount id.

accessToken

The quoted access token. Keep this safe and secure.

sinceDate

Quoted beginning date of when to aggregate data in the format of "2018-11-09".

untilDate

Quoted end date of when to aggregate data in the format of "2018-11-09".

verbose

Defaults to TRUE, and will report the details of the call.

Value

Returns a dataframe with a row for each ad. All columns are character.


RonGuymon/ronsFunctions documentation built on May 8, 2019, 11:42 a.m.