如何获得当前平均CPC使用R(最好是R)或Python出价对Google AdWords API中的关键字出价吗?

时间:2018-10-22 15:00:31

标签: python r google-adwords

所以我有点卡住了。我想使用R从Adwords API中提取关键字列表的平均CPC和最高CPC出价。如果很难,python也可以正常工作:)。

我尝试使用RAdwords,但是在adwords https://developers.google.com/adwords/api/docs/appendix/reports

的列表中找不到正确的报告类型。

任何人对此都有任何经验。为方便起见,我在adwords界面中附有一张图片,可轻松看到测量结果。enter image description here

1 个答案:

答案 0 :(得分:0)

使用 RAdwords 包,您可以查询Adwords / Google Ads API并下载所有关键字统计信息。相应的报告类型为KEYWORDS_PERFORMANCE_REPORT。请注意,在Adwords API文档中,criteria与该报告类型内的关键字文本相关。

# Authentication
library(RAdwords)
google_auth <- doAuth()
# Create the statement
body <- statement(select = c('Criteria', 'AverageCpc', 'CpcBid'),
                  report = "KEYWORDS_PERFORMANCE_REPORT",
                  start = "2018-01-01",
                  end = "2018-01-10")
# Query the Google Ads API
# Make sure to use the Adwords Account Id (MCC Id will not work)
data <- getData(clientCustomerId = 'xxx-xxx-xxxx',
                google_auth = google_auth,
                statement = body)