Device data outputting nothing?

87 views
Skip to first unread message

Alex

unread,
Jan 23, 2025, 6:09:13 AM1/23/25
to Google Ads API and AdWords API Forum
When requesting device breakdown it responds with only the combined totals for monthly data

def generate_historical_metrics(client, customer_id, keywords, output_csv):
keyword_plan_idea_service = client.get_service("KeywordPlanIdeaService")
request = client.get_type("GenerateKeywordHistoricalMetricsRequest")
request.customer_id = customer_id
request.keywords.extend(keywords)
request.include_adult_keywords = True
request.keyword_plan_network = client.enums.KeywordPlanNetworkEnum.GOOGLE_SEARCH
request.language = client.get_service("GoogleAdsService").language_constant_path("1000")
request.historical_metrics_options.year_month_range.start.year = today.year - 4
request.historical_metrics_options.year_month_range.start.month = client.enums.MonthOfYearEnum.DECEMBER
request.historical_metrics_options.year_month_range.end.year = today.year
request.historical_metrics_options.year_month_range.end.month = client.enums.MonthOfYearEnum.NOVEMBER
request.aggregate_metrics.aggregate_metric_types = [client.get_type("KeywordPlanAggregateMetricTypeEnum").KeywordPlanAggregateMetricType.DEVICE]

Google Ads API Forum Advisor

unread,
Jan 23, 2025, 10:36:18 AM1/23/25
to alexc...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Metrics like search volume are updated monthly by looking at the last month's search volume. This is the same data as Google Trends. I suggest you check this Keyword Ideas documentation for more information. 

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGy5w:ref" (ADR-00285616)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 

 

Alex

unread,
Jan 24, 2025, 3:51:43 AM1/24/25
to Google Ads API and AdWords API Forum
KeywordPlanAggregateMetricType.DEVICE returns nothing

Google Ads API Forum Advisor

unread,
Jan 24, 2025, 4:39:08 AM1/24/25
to 1...@alexcanton.com, adwor...@googlegroups.com

Hi,

To check further from our end, please get back to us the complete API logs (request and response with request-id and request header) generated at your end so that we can check and assist you further. It will help us to investigate why you are getting empty results in the API response.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can send the details via the Reply privately to the author option or a direct private reply to this email.

Alex

unread,
Jan 24, 2025, 6:39:55 AM1/24/25
to Google Ads API and AdWords API Forum
Can you give me an example of it returning devices break down. I dont mind if it's a REST API or a specific library. Just show me it works..

Google Ads API Forum Advisor

unread,
Jan 24, 2025, 11:28:36 AM1/24/25
to alexc...@gmail.com, adwor...@googlegroups.com
Hi,

In order to assist you further, please provide us with the uncropped UI screenshot of the reports by highlighting data that you're trying to retrieve via the API.

Alex

unread,
Jan 24, 2025, 7:24:43 PM1/24/25
to Google Ads API and AdWords API Forum

Google Ads API Forum Advisor

unread,
Jan 26, 2025, 11:10:51 PM1/26/25
to alexc...@gmail.com, adwor...@googlegroups.com
Hi,

As requested in the previous email, please share the following details :
  • uncropped Google Ads UI screenshot of the field/data you would like to obtain via the Google Ads API 
  • complete API logs (request and response with request-id and request header) generated at your end. If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.
This information will help us analyze why the aggregateMetrics is not being returned when trying to generate generateKeywordHistoricalMetrics.

Alex

unread,
Jan 27, 2025, 8:12:56 PM1/27/25
to Google Ads API and AdWords API Forum

 this "latutilanne" random word shows the device breakdown values on the line graph but not the pie chart therefore the api returns nothing for devices. even though there is device data on line graph

Device data here
Image

But not in device pie chart, same as api
Image

Given there is data it should return in the api

Alex

unread,
Jan 27, 2025, 8:13:30 PM1/27/25
to Google Ads API and AdWords API Forum
I have tried this on rest api and python library and linked the issue here which others have https://github.com/googleads/google-ads-python/issues/721

Google Ads API Forum Advisor

unread,
Jan 28, 2025, 2:31:43 AM1/28/25
to alexc...@gmail.com, adwor...@googlegroups.com
Hi,

I couldn't see the images of the "latutilanne" keyword that you have shared earlier, could you please provide as attachment to this email thread. Also, include the earlier requested information that helps to assist further:
  • uncropped Google Ads UI screenshot of the field/data you would like to obtain via the Google Ads API 
  • complete API logs (request and response with request-id and request header) generated at your end. If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.
 
Reply all
Reply to author
Forward
0 new messages