Learn R Programming

rfacebookstat (version 2.11.0)

fbGetAds: Get ads list from facebook marketing API

Description

Get ads list with parameters from facebook marketing API. Contains information to display an ad and associate it an ad set. Each ad is associated with an ad set and all ads in a set have the same daily or lifetime budget, schedule, and targeting. Creating multiple ads in an ad set helps optimize their delivery based on variations in images, links, video, text or placements.

Usage

fbGetAds(accounts_id  = getOption("rfacebookstat.accounts_id"), 
         api_version  = getOption("rfacebookstat.api_version"),
		 username     = getOption("rfacebookstat.username"),
	     token_path   = fbTokenPath(),
         access_token = getOption("rfacebookstat.access_token"))

Value

Data frame with ads list.

1. id

The ID of this ad.

2. name

Name of the ad.

3. creative_id

The ID or creative spec of the ad creative to be used by this ad.

4. adset_id

The ID of the ad set, required on creation.

5. campaign_id

ID of the ad campaign that contains this ad.

6. account_id

The ID of the ad account that this ad belongs to.

7. bid_amount

Bid amount for this ad which will be used in auction instead of the ad set bid_amount, if specified. Any updates to the ad set bid_amount will overwrite this value with the new ad set value.

8. bid_type

Bid type, one of CPC, CPM, MULTI_PREMIUM, ABSOLUTE_OCPM, CPA

9. configured_status

The configured status of the ad.

10. effective_status

The effective status of the ad. The status could be effective either because of its own status, or the status of its parent units.

Arguments

accounts_id

Your account ID, for example 'act_11111111111111111'.

api_version

Current Facebook API version.

username

your username on Facebook

token_path

path to dir with credentials

access_token

Your facebook API token.

Author

Alexey Seleznev

Examples

Run this code
if (FALSE) {
library(rfacebookstat)
fb_token <- fbGetToken(app_id = 0000000)
ads <- fbGetAds(accounts_id  = "act_11111111111111111",
                api_version  = 'v3.0',
                access_token = fb_token)
}

Run the code above in your browser using DataLab