Build Adwords Query Language Statement
Generates and builds the Adwords Query Language Statement for querying the Adwords API.
statement(select = c("AccountDescriptiveName", "AccountId", "Impressions", "Clicks", "Cost", "Date"), report = "ACCOUNT_PERFORMANCE_REPORT", where, start = "2018-01-01", end = "2018-01-10", apiVersion = "201809", compress = TRUE)
select
: Attributesreport
: Report typewhere
: Condition list, e.g. "CampaignName STARTS_WITH 'A' AND Clicks > 100", multiple conditions can be only combined with AND Operators: = | != | > | >= | < | <= | IN | NOT_IN | STARTS_WITH | STARTS_WITH_IGNORE_CASE | CONTAINS | CONTAINS_IGNORE_CASE | DOES_NOT_CONTAIN | DOES_NOT_CONTAIN_IGNORE_CASEstart
: Beginning of date range. Format: 2018-01-01end
: End of date rage. Format: 2018-01-10apiVersion
: Adwords API Version, supports 201809, 201806, 201802 defaults to 201809.compress
: TRUE / FALSE, Gzipped data download if TRUEThe statement neccessary for the getData
function.
body <- statement(select=c('CampaignName','Clicks','Cost','Ctr'), report="CAMPAIGN_PERFORMANCE_REPORT", where="CampaignName STARTS_WITH 'A' AND Clicks > 100", start="2018-01-20", end="2018-01-21") body <- statement(select=c('Criteria','Clicks','Cost','Ctr'), report="KEYWORDS_PERFORMANCE_REPORT", where="Clicks > 100", start="2018-01-20", end="2018-01-21") body <- statement(select=c('Clicks','AveragePosition','Cost','Ctr'), report="ACCOUNT_PERFORMANCE_REPORT", start="2018-01-20", end="2018-01-21")
Useful links