Google 广告 API 指标成本、每次点击费用等太大了
Google Ads API metrics cost, cpc, etc. way too big
所以我使用下面显示的代码查询了 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)
是的,这是预期的行为。成本指标是微量的,因此需要除以 1000,000。 API 论坛上的类似主题有更多详细信息:https://groups.google.com/g/adwords-api/c/K4ux3hmlego?pli=1
所以我使用下面显示的代码查询了 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)
是的,这是预期的行为。成本指标是微量的,因此需要除以 1000,000。 API 论坛上的类似主题有更多详细信息:https://groups.google.com/g/adwords-api/c/K4ux3hmlego?pli=1