简体   繁体   English

Google Ads API 指标成本、每次点击费用等太大了

[英]Google Ads API metrics cost, cpc, etc. way too big

So I've queried the location_view resource using the code shown below.所以我使用下面显示的代码查询了location_view资源。 I've tried something similar using the geographic_view , but it also leads to the same problem.我已经尝试过使用geographic_view类似的东西,但它也导致了同样的问题。 This problem is that metrics like average_cost or average_cpc are ~2800000 .这个问题是, average_costaverage_cpc等指标是~2800000 Now this obviously can't be correct.现在这显然不可能是正确的。 I was wondering if anyone has had a similar problem or if maybe, the actual value is multiplied by a factor of 1M or something我想知道是否有人遇到过类似的问题,或者如果可能,实际值乘以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) 

Yes, this is expected behavior.是的,这是预期的行为。 The cost metrics are micros, so need to be divided by 1000,000.成本指标是微观的,因此需要除以 1000,000。 There's more detail on a similar thread on the API forum: https://groups.google.com/g/adwords-api/c/K4ux3hmlego?pli=1 API 论坛上的类似主题有更多详细信息: https : //groups.google.com/g/adwords-api/c/K4ux3hmlego?pli=1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM