GenerateHistoricalMetricsResponse is empty for a particular keywords plan

168 views
Skip to first unread message

Maxim Kurapatkin

unread,
Mar 2, 2023, 6:06:41 AM3/2/23
to Google Ads API and AdWords API Forum
Hello,
I'm able retrieve historical info for keywords plan in adwords.
But with api request response.metrics == []

GenerateHistoricalMetricsRequest is:
keyword_plan: "customers/XXX/keywordPlans/625987651"
historical_metrics_options {
  year_month_range {
    start {
      year: 2022
      month: JANUARY
    }
    end {
      year: 2023
      month: JANUARY
    }
  }
  include_average_cpc: true
}


google-ads version "20.0.0"


Google Ads API and AdWords API Forum

unread,
Mar 2, 2023, 1:19:29 PM3/2/23
to Google Ads API and AdWords API Forum
Re-posting the last inquiry (https://groups.google.com/g/adwords-api/c/Qzi9KHQcP9w) from the forum as it wasn't routed to our support queue.

Regards,
Google Ads API Team

Google Ads API Forum Advisor

unread,
Mar 2, 2023, 4:44:01 PM3/2/23
to adwor...@googlegroups.com

Hi,

Thanks for reaching out to the Google Ads API Forum.

I understand that you were able to retrieve historical info for keywords plan via Google Ads API but the response shows it as response.metrics == []. Can you please confirm if the UI's Keyword Planner is showing the same results as the API response shown? If yes, then Google Ads API mirrors the Google Ads UI. If not, then you may note that the KeywordPlanService.GenerateHistoricalMetrics has similar functionality in the UI's Keyword Planner. But, the API requires that you create a KeywordPlan first, and there are differences when working with a keyword plan using the Google Ads API versus the UI. You may refer to these recommendations on how to avoid mismatches in historical metrics when mixing usage. For more information, you may refer to this page.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2jIaR2:ref

Maxim Kurapatkin

unread,
Mar 2, 2023, 10:37:34 PM3/2/23
to Google Ads API and AdWords API Forum
Hi,
It is a plan with 2 keywords inside. Plan created by adwords UI. Adwords UI return historical metrics for these two keywords. No problems with that.
Now i connect to plan thru Ads API (version 13). get the plan and run generate_historical_metrics against it. But the response is zero, no keywords no metrics.

I tried another way. Open plan thru API and then tried to add keywords thru UI. But no success. UI failed to open the plan.

I'm pretty sure it is something about API versions or i have to add plan campaign, adgroup and keyword thru API when creating the plan from API?

Probably no way to manage plan thru UI and pull metrics from API? Please advice.

Ana K

unread,
Mar 14, 2023, 1:36:26 PM3/14/23
to Google Ads API and AdWords API Forum
I'm seeing the same issue, and it seems to be new. In the past I regularly ran API requests using the syntax https://googleads.googleapis.com/v13/customers/1111111/keywordPlans/2222222:generateHistoricalMetrics. Where it says  2222222  I'd plug in the plan ID after creating the keyword plan through the Google Ads UI. In the past, data viewed in the UI or retrieved via the API always matched. 

In the past few weeks, this seems to have changed such that any new plans created in the UI now result in empty object {} when running the request URL shown above (data is still available through the UI). This seems to be related to a recent format change, since old plan IDs work until I hit the ""You must update this plan to a newer format to open it. This format can be used with a new feature that automatically organizes keywords into ad groups"" and click Continue. Once the plan is updated, the API request starts returning the empty object instead of historical metrics.

Is this a known change or limitation of the new plan formats?

veyisahsak2735

unread,
Mar 14, 2023, 7:36:20 PM3/14/23
to a...@mixedanalytics.com, Google Ads API and AdWords API Forum
Name veyis ahşak 31121993 turkey sahinbey gaziantep banka bilgileri turkey is bankasi hesap no 63011049224 kimlik 50632475462 telefon 05396312735



Samsung Galaxy akıllı telefonumdan gönderildi.

-------- Orijinal mesaj --------
Başlangıç tarihi: Ana K <a...@mixedanalytics.com>
Tarih: 14.03.2023 15:36 (GMT+02:00)
Alıcı: Google Ads API and AdWords API Forum <adwor...@googlegroups.com>
Konu: Re: GenerateHistoricalMetricsResponse is empty for a particular keywords plan

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
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 adwords-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/5d3c8b51-97d7-49e5-a761-1367021a8070n%40googlegroups.com.

Google Ads API Forum Advisor

unread,
Mar 14, 2023, 7:41:30 PM3/14/23
to veyisah...@gmail.com, a...@mixedanalytics.com, adwor...@googlegroups.com

Hi Ana, 

Thank you for coming back to us. I hope you are doing well today.

Moving forward to your concern about there are differences when working with a keyword plan using the Google Ads API versus the UI,  for our team to further compare, investigate, and validate why you are encountering issues, could you please provide us with the complete logs (request and response with request-id) generated on your end (where the error is shown) and the Google Ads UI screenshot (Non-cropped) of the data you are retrieving? This will help us to provide right information and recommendations in Google Ads API perspective.

Have a great day.

Regards

Veyis Ahsak

unread,
Mar 14, 2023, 7:42:26 PM3/14/23
to Google Ads API Forum Advisor, a...@mixedanalytics.com, Google Ads API and AdWords API Forum
Sure, will do that. 

14 Mar 2023 Sal 21:41 tarihinde Google Ads API Forum Advisor <ads...@forumsupport.google> şunu yazdı:

Google Ads API Forum Advisor

unread,
Mar 14, 2023, 7:50:23 PM3/14/23
to veyisah...@gmail.com, a...@mixedanalytics.com, adwor...@googlegroups.com

Hi,

Thanks for coming back to us. I hope you are doing well today.

In addition, you can provide information needed via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Have a great day.

Regards,

Veyis Ahsak

unread,
Mar 14, 2023, 7:51:17 PM3/14/23
to Google Ads API Forum Advisor, a...@mixedanalytics.com, Google Ads API and AdWords API Forum
Thank you, I will do that. 

14 Mar 2023 Sal 21:50 tarihinde Google Ads API Forum Advisor <ads...@forumsupport.google> şunu yazdı:

Trent Raynard

unread,
Mar 15, 2023, 5:44:41 AM3/15/23
to Google Ads API and AdWords API Forum
I am seeing the same issue as Ana K. When viewing a created keyword plan in UI it prompts to update, then after I update, I get an empty response back for historical metrics. If I do not update with the UI prompt, I am still receiving metrics 

Google Ads API Forum Advisor

unread,
Mar 15, 2023, 11:09:24 AM3/15/23
to tre...@helium10.com, adwor...@googlegroups.com

Hi Trent, 

Thank you for reaching out to us.

Could you confirm if you already consider differences when working with a keyword plan using the Google Ads API versus the UI? You may refer to these recommendations on how to avoid mismatches in historical metrics when mixing usage. For more information, you may refer to this page.

However, if you have indeed considered it, could you also please provide us with the complete logs (request and response with request-id) generated on your end (where the issue is shown) and the Google Ads UI screenshot (non-cropped) of the data you are retrieving? This will help us provide the right information and recommendations from the Google Ads API perspective.

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,
Reply all
Reply to author
Forward
0 new messages