if (FALSE) {
# set client id
gads_set_customer_id('xxx-xxx-xxxx')
# set manager id
gads_set_login_customer_id('xxx-xxx-xxxx')
# get list of plan
plan_data <- gads_get_report(
resource = 'keyword_plan',
fields = c('keyword_plan.id')
)
# get keyword historical data
historical_plan_data <- gads_keyword_plan_historical_metrics(
keyword_plan_id = plan_data$keyword_plan_id[1]#'
)
# main plan data
data <- historical_plan_data$main_data
historical_data <- historical_plan_data$historical_data
}
Run the code above in your browser using DataLab