Google Ads API 指标成本、每次点击费用等太大了
Posted
技术标签:
【中文标题】Google Ads API 指标成本、每次点击费用等太大了【英文标题】:Google Ads API metrics cost, cpc, etc. way too big 【发布时间】:2021-06-21 13:41:14 【问题描述】:所以我使用下面显示的代码查询了location_view
资源。我使用geographic_view
尝试过类似的操作,但它也会导致同样的问题。这个问题是average_cost
或average_cpc
之类的指标是~2800000
。现在这显然是不正确的。我想知道是否有人遇到过类似的问题,或者如果可能,实际值乘以 1M
或其他因素
from google.ads.googleads.client import GoogleAdsClient
credentials =
"developer_token": "xx",
"refresh_token": "xx",
"client_id":"xx",
"client_secret": "xx"
client = GoogleAdsClient.load_from_dict(credentials)
query = """
SELECT location_view.resource_name, segments.date, metrics.average_cost, metrics.average_cpc, metrics.clicks, metrics.conversions, metrics.cost_micros, metrics.cost_per_conversion, metrics.impressions, metrics.interactions, metrics.interaction_rate, campaign.id, campaign.name, campaign.end_date, campaign.start_date FROM location_view WHERE segments.date DURING LAST_30_DAYS"""
ga_service = client.get_service("GoogleAdsService")
search_request = client.get_type("SearchGoogleAdsStreamRequest")
search_request.customer_id = "xx"
search_request.query = query
test = []
response = ga_service.search_stream(search_request)
for batch in response:
for row in batch.results:
test.append(row)
【问题讨论】:
【参考方案1】:是的,这是预期的行为。成本指标是微观的,因此需要除以 1000,000。 API 论坛上的类似主题有更多详细信息:https://groups.google.com/g/adwords-api/c/K4ux3hmlego?pli=1
【讨论】:
以上是关于Google Ads API 指标成本、每次点击费用等太大了的主要内容,如果未能解决你的问题,请参考以下文章
在 Google Cloud Platform Console 上启用 Google Ads API 的问题
无法获取经理帐户的 Google Ads 指标,无法获得客户帐户的权限
使用 python 获取“成本”google adwords api