Learn R Programming

lares (version 4.8.4)

fb_insights: Facebook Insights API

Description

This returns all available FB insights per day including any given breakdown to the specified report level, and place into a data frame. For more information on Ad Insights' API, go to the original documentaion

Usage

fb_insights(
  token,
  which,
  start = Sys.Date() - 7,
  end = Sys.Date(),
  time_increment = "1",
  report_level = "campaign",
  breakdowns = NA,
  api_version = "v3.3"
)

Arguments

token

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

which

Character vector. This is the accounts, campaigns, adsets, or ads IDs to be queried

start

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

end

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

time_increment

Character. Agrupaci<U+00F3>n por meses (monthly), para todo junto (all_days) o un entero para cantidad de d<U+00ED>as [1-90]. Por defecto, traer<U+00E1> cada d<U+00ED>a por separado (i.e.=1)

report_level

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

breakdowns

Character Vector. One or more of breakdowns for segmentation results. Set to NA for no breakdowns

api_version

Character. Facebook API version

Details

This function was based on FBinsightsR.

See Also

Other API: bring_api(), fb_accounts(), fb_ads(), fb_creatives(), fb_posts(), fb_post(), li_auth(), li_profile(), queryGA(), slackSend()

Other Facebook: fb_accounts(), fb_ads(), fb_creatives(), fb_posts(), fb_post()