[KeywordPlanService.GenerateHistoricalMetrics]About avg_monthly_searches when specifying a period

213 views
Skip to first unread message

team AD-kwd

unread,
Jul 5, 2022, 7:08:32 AM7/5/22
to Google Ads API and AdWords API Forum
Hi team,
When calling KeywordPlanServiceGapicClient#generateHistoricalMetrics, you specified a past date in the parameter year_month_range.

https://developers.google.com/google-ads/api/reference/rpc/v11/KeywordPlanHistoricalMetrics
As a response, monthly_search_volumes was set to the volume for the specified period, but avg_monthly_searches was set to the average monthly search volume for the last 12 months.

Is there a way to get the average monthly search volume for the period set in the parameter instead of the average monthly volume for the last 12 months?

I am sorry to trouble you, but I appreciate your support.

[Supplementary information]
https://groups.google.com/g/adwords-api/c/imL_xZ5MalA/m/tjQB3qWCCAAJ
A question similar to this one was raised in the above conversation.

Google Ads API Forum Advisor

unread,
Jul 5, 2022, 11:18:32 AM7/5/22
to travel...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to us.

You may refer to this historicalMetricsOptions and use the year_month_range. Let us know if you are able to get expected data on your end.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cG8O0:ref

team AD-kwd

unread,
Jul 6, 2022, 3:11:09 AM7/6/22
to Google Ads API and AdWords API Forum
Thank you for your reply.

The period was specified in year_month_range.

To give a specific example, for example, when searching for the word "東京タワー" with a period of 2020/06-2021/05,
monthly average search volume for screen version: 165,000
Monthly average search volume for API version(avg_monthly_searches): 301,000
Will be returned.All of these are targeted in Japan.
* The value of 301,000 for the API version is the same as the monthly average search volume value for the last 12months(2022/06-2021/05).

[Supplementary information]
When you search for the word "東京タワー" by setting the period of 2020/06-2021/05 with the API, the same value as the screen version will be returned for the search volume (monthly_search_volumes) of each month.

2022年7月6日水曜日 0:18:32 UTC+9 adsapi:

team AD-kwd

unread,
Jul 6, 2022, 3:28:22 AM7/6/22
to Google Ads API and AdWords API Forum
> * The value of 301,000 for the API version is the same as the monthly average search volume value for the last 12months(2022/06-2021/05).
sorry, I made a mistake. The following is the correct sentence.
* The value of 301,000 for the API version is the same as the monthly average search volume value for the last 12months(2021/06-2022/05).
2022年7月6日水曜日 16:11:09 UTC+9 team AD-kwd:

Google Ads API Forum Advisor

unread,
Jul 6, 2022, 3:39:29 AM7/6/22
to travel...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

I understand that the value of 301,000 for the API version is the same as the monthly average search volume value for the last 12 months(2021/06-2022/05) on your end. However, for us to check the behavior more closely, and investigate further, could you please provide us with the complete request and response logs with the request-id generated in text format? You may enable logging so you’ll get complete request and response logs along with request-id by navigating to the Client libraries > Your client library (ex Java) > Logging documentation, which you can access from this link

You may then provide those logs by reply privately to author option.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cG8O0:ref

team AD-kwd

unread,
Jul 7, 2022, 8:01:52 AM7/7/22
to Google Ads API and AdWords API Forum
Hi Yasar,

Thank you for teaching me the procedure.

I just sent a message with a log file attached in a private setting.
If you do not receive it, we would appreciate it if you could point it out.
* It may be a specification, but I'm worried that the message sent to this account on the sending side may not be displayed for some reason and may not have been sent correctly.

2022年7月6日水曜日 16:39:29 UTC+9 adsapi:

Google Ads API Forum Advisor

unread,
Jul 7, 2022, 10:38:28 AM7/7/22
to travel...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for providing us with the requested information.

Upon checking the provided logs with us, I can see that avgMonthlySearches is 301000 for the period of 2020/06-2021/05. It appears that this is working as intended since I have tried on my end as well, and I can confirm that the avgMonthlySearches is coming the same even though we have different date ranges using year_month_range. This is because our documentation says that the Average monthly searches is for the past 12 months. You may see below screenshot:

 

 

Could you please confirm if avgMonthlySearches is different for 2020/06-2021/05 as compared with the last 12 months avgMonthlySearches value when using Ads UI’s Keyword Planner? If yes, could you please provide privately to our team 2 screenshots from Ads UI’s Keyword Planner showing the different avgMonthlySearches for 2020/06-2021/05  and last 12 months date? 

However, you may refer to this guide, for the differences when working with a keyword plan using the Google Ads API versus the UI. We also give some recommendations on how to avoid mismatches in historical metrics when mixing usage.

Regards,

Message has been deleted
Message has been deleted
Message has been deleted

Google Ads API Forum Advisor

unread,
Jul 12, 2022, 9:00:18 AM7/12/22
to travel...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for providing us requested information. Allow me to reach out to my rest of the team. We will provide updates shortly.

Regards,

Google Ads API Forum Advisor

unread,
Jul 12, 2022, 3:11:55 PM7/12/22
to adwor...@googlegroups.com, travel...@gmail.com
Hi,

As per feedback from our team, you may refer to this documentation for more information on the differences you are observing when using the planning services of both the API and the UI. Due to different behaviors of the API and UI, the consequences are then listed in this section, and recommendations are then discussed here check on mismatches between the two platforms.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cG8O0:ref
Message has been deleted
Message has been deleted

Google Ads API Forum Advisor

unread,
Jul 22, 2022, 7:37:45 AM7/22/22
to travel...@gmail.com, adwor...@googlegroups.com
Hello,

Thank you for getting back to us. I am Sherwin from Google Ads API and I work with Yasar and Peter. I hope that you are doing well today.

This sounds like the feature the HistoricalMetricsOptions feature that allows users to specify the Year/Month range of the historical stats to retrieve. Based on this document about the HistoricalMetricsOptions, the year month range for historical metrics. If not specified the searches will be returned for past 12 months. Searches data is available for the past 4 years. If the search volume is not available for the entire year_month_range provided, the subset of the year month range for which search volume is available will be returned.

If you have other concerns, feel free to reply in this thread.

Kind regards,
Google Logo
Sherwin Vincent
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cG8O0:ref

team AD-kwd

unread,
Aug 5, 2022, 4:45:55 AM8/5/22
to Google Ads API and AdWords API Forum
Hi Yasar,


>Thanks for providing us requested information. Allow me to reach out to my rest of the team. We will provide updates shortly.
Thank you for your confirmation.
---------------------------------------------------------
Hi Peter,


>As per feedback from our team, you may refer to this documentation for more information on the differences you are observing when using the planning services of both the API and the UI.
Thank you for sharing.

However, this time, only the monthly search average volume of the UI version and the API version is different.
The search volume for each month of the UI and API versions was all the same.
Therefore, it is unlikely that the concerns raised in the shared material will be met.
 * I created keyword plans for API version and screen version respectively and checked the search amount, but they matched.
 * If you need evidence, we will send it again.
   
What we are looking for is a way to get the average monthly search volume(avg_monthly_searches) for past dates in the API version.
If your current API version doesn't allow you to get the above, we'll move to manually calculating it from monthly search volume.

2022年7月22日金曜日 20:37:45 UTC+9 adsapi:

team AD-kwd

unread,
Aug 5, 2022, 4:48:01 AM8/5/22
to Google Ads API and AdWords API Forum
Hi Sherwin,

Thank you for your contact.

As mentioned above, we are already using the HistoricalMetricsOptions function.
The problem this time is that when I specify a date, the average monthly search volume (avg_monthly_searches) for that time period is incorrectly populated with results.
I have shared detailed evidence regarding this matter with Mr. Yasar, so I would appreciate it if you could check it.
 * If it is better to re-acquire the evidence, we will acquire and share the latest results of the API version and the screen version.
2022年8月5日金曜日 17:45:55 UTC+9 team AD-kwd:

Google Ads API Forum Advisor

unread,
Aug 5, 2022, 12:21:58 PM8/5/22
to travel...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

Since you mentioned that when you specified a date, the average monthly search volume (avg_monthly_searches) for that time period is incorrectly populated with results. If you’re talking about the avgMonthlySearches coming the same even though we have different date ranges using year_month_range as compared with past 12 months, with the past any date range, then it is working as expected. This is because Average monthly searches for the past 12 months can be pulled only.

If your concern is different from what is explained above, then you may provide us details such as complete logs(privately from Forum thread), but I recommend you to open a new thread so we may avoid mixing issues altogether.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cG8O0:ref
Reply all
Reply to author
Forward
0 new messages