fbins_ag: Get FB insights by age & gender.

View source: R/functions.R

fbins_agR Documentation

Get FB insights by age & gender.

Description

This returns all available FB insights per day including age and gender breakdown to the specified report level, and place into a data frame. When reporting by age and gender the FB API can timeout when reporting on only a few days. This function allows you to pull one day at a time if needed.

Usage

fbins_ag(start_date, until_date, report_level, fb_access_token, account)

Arguments

start_date

The first full day to report, in the format "YYYY-MM-DD" .

until_date

The last full day to report, in the format "YYYY-MM-DD" .

report_level

One of "ad", "adset", "campaign" or "account" .

fb_access_token

This must be a valid access token with sufficient privileges. Visit the Facebook API Graph Explorer to acquire one.

account

This is the ad account, campaign, adset or ad ID to be queried.

Examples

fbins_ag("start_date", "until_date", "report_level", "fb_access_token", "account")
fbins_ag("2017-01-20", "2017-01-22", "ad", "ABCDEFG1234567890ABCDEFG", "act_12345678")

Deducive/FBinsightsR documentation built on April 4, 2023, 3:57 a.m.