rgoogleads-package {rgoogleads}R Documentation

Loading Data From 'Google Ads API'

Description

logo Interface for loading data from 'Google Ads API', see https://developers.google.com/google-ads/api/docs/start. Package provide function for authorization and loading reports.

Capabilities of rgoogleads:

Author(s)

Alexey Seleznev

See Also

Examples

## Not run: 
library(rgoogleads)

# set own oauth app
gads_auth_configure(path = 'C:/auth/app.json')
# set your developer token if needed, or use default developer token
gads_auth(email = 'me@gmail.com', developer_token = "own developer token")

# get list of accessible accounts
my_accounts <- gads_get_accessible_customers()

# set manager account id
gads_set_login_customer_id('xxx-xxx-xxxx')

# set client account id
gads_set_customer_id('xxx-xxx-xxxx')

# load report data
ad_group_report <- gads_get_report(
  resource    = "ad_group",
  fields = c("ad_group.campaign",
             "ad_group.id",
             "ad_group.name",
             "ad_group.status",
             "metrics.clicks",
             "metrics.cost_micros"),
  date_from   = "2021-06-10",
  date_to     = "2021-06-17",
  where       = "ad_group.status = 'ENABLED'",
  order_by    = c("metrics.clicks DESC", "metrics.cost_micros")
)

## End(Not run)


[Package rgoogleads version 0.11.0 Index]