I am trying to get historical, monthly CPC values from a keyword plan.
As per
https://developers.google.com/google-ads/api/reference/rpc/v10/KeywordPlanHistoricalMetrics,
I am using the following code to attempt retrieving the information:
*Code:*
keyword_plan_service = client.get_service("KeywordPlanService")
metric_request = client.get_type("GenerateHistoricalMetricsRequest")
resource_name = keyword_plan_service.keyword_plan_path(customer_id,
keyword_plan_id)
metric_request.keyword_plan=resource_name
metric_request.historical_metrics_options.year_month_range.start.year=2019
metric_request.historical_metrics_options.year_month_range.start.month=
client.get_type("MonthOfYearEnum").MonthOfYear.JANUARY
metric_request.historical_metrics_options.year_month_range.end.year=2021
metric_request.historical_metrics_options.year_month_range.end.month=client
.get_type("MonthOfYearEnum").MonthOfYear.MAY
response = keyword_plan_service.generate_historical_metrics(metric_request)
print(response)
Changing the period *start* and *end* related time variables, inherent
monthly volumes are returned, but *low_top_of_page_bid_micros* and
*high_top_of_page_bid_micros
*aggregates remain the same (independently from the time period requested).
I assume the values are always referring to last 12 months, and I wonder if
there is a way to request the cpc estimates for a specific time period
instead.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/a1eb3b03-3e7e-4b56-88f4-4b320364c9d3n%40googlegroups.com.