How to decode age range, gender, device etc from google ads api

701 views
Skip to first unread message

Bing Bu

unread,
Oct 7, 2021, 6:28:18 PM10/7/21
to AdWords API and Google Ads API Forum
Hi,

We are trying to switch to google ads api, and notice the 
returned values for age range, gender, device etc are numbers
not string names.
I wonder where could we find the mapping between those numbers
and human readable string names.
For instance, the age range 
503001, 503002, 503003, 503004, 503005, 503006, 503999

I guess 503001 is for 18-24, is that correct?

Bing

Bing Bu

unread,
Oct 7, 2021, 7:08:47 PM10/7/21
to AdWords API and Google Ads API Forum
Just found the code format reference:

All good now for age range and gender.
However, for device, I got 2, 3, 4, 6 from the google ads api,
but your reference gives

Platform name Criterion ID
Desktop 30000
HighEndMobile 30001
Tablet 30002
ConnectedTv 30004

They do not match.
Where could I find reference for the device type id 2, 3, 4, 6?

Bing

Google Ads API Forum Advisor

unread,
Oct 8, 2021, 12:49:58 PM10/8/21
to xueb...@strikesocial.com, adwor...@googlegroups.com
Hi Bing,

https://developers.google.com/google-ads/api/reference/rpc/v8/DeviceEnum.Device is what you are looking for.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2PHr0d:ref

Bing Bu

unread,
Oct 8, 2021, 1:24:19 PM10/8/21
to AdWords API and Google Ads API Forum
Hi Aryeh,

Thanks for the info.
But how could I map the integer id values to these string names?
I mean I get device id 2, 3, 4, 6 from google ads api,
and I have no idea how to map these ids to the string names.
Is 2 for Desktop?

Bing

Google Ads API Forum Advisor

unread,
Oct 11, 2021, 5:01:20 AM10/11/21
to xueb...@strikesocial.com, adwor...@googlegroups.com

Hi Bing,

This is Yasar and I work with Aryeh. Let me assist you with this.

Kindly note that the retrieved device id numerical value of the enum will vary depending on the client library that you’re using to get it. With this, I recommend you to reach out to the respective client library owner by filing an issue on the issue tracker on the Issue tab of your chosen client library on the github, so that they can provide guidance on it. Also, we recommend that you use the enum instead of their code so that you don't have to convert the enum to its numerical value.

Let us know if you have any further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2PHr0d:ref

Bing Bu

unread,
Oct 11, 2021, 10:55:58 AM10/11/21
to AdWords API and Google Ads API Forum
Hi Yasar,

Got this.
We will store the string name from the enum instead.
All good now.

Thanks,

Bing

Neeraj Sharma

unread,
Sep 23, 2022, 3:15:32 AM9/23/22
to Google Ads API and AdWords API Forum

hello,

Did you got the resolution for this. I'm also facing same issue. Can you please provide the resolution to me as well.
Reply all
Reply to author
Forward
0 new messages