Adwords to Ads API migration - UseRawEnumValues

244 views
Skip to first unread message

Gaurav Suri

unread,
Jun 2, 2021, 1:18:55 AM6/2/21
to AdWords API and Google Ads API Forum
Hello Team,

We are in the process of migrating Google Adwords to Ads API for our reporting needs.

There is a parameter called 'UseRawEnumValues' available in the Adwords API, using which, it returns the display value of the enum.
For eg - For Ad Type, one possible value is 'Expanded text ad'

In case of Ads API, this is returned as an enum ordinal '3' (which corresponds to the enum Text 'EXPANDED_TEXT_AD') . So while migrating, the report format / values are changing.

Is there a way, we can get the display value for the enum from Ads API ? What are the alternatives, if it is not supported by the API ?

Thank you

Google Ads API Forum Advisor Prod

unread,
Jun 2, 2021, 1:30:05 PM6/2/21
to gaura...@emxdigital.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. Can you please clarify how you are retrieving the enum ordinal for the ad type in the Ads API? 

Thanks,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2HzWQD:ref

Gaurav Suri

unread,
Jun 3, 2021, 1:08:12 AM6/3/21
to AdWords API and Google Ads API Forum
Hello Matt,

Here is the code we use:
query = '''SELECT segments.date,campaign.name,ad_group.name,ad_group_ad.ad.type,metrics.impressions from ad_group_ad WHERE segments.date DURING YESTERDAY'''
search_request = googleads_client.get_type("SearchGoogleAdsStreamRequest")
search_request.customer_id = 'xxxxxxxxxx'
search_request.query = query
response = ga_service.search_stream(search_request)
for batch in response:
    for row in batch.results:
           print(row.ad_group_ad.ad.type_)


Thank you.

Google Ads API Forum Advisor Prod

unread,
Jun 3, 2021, 1:05:00 PM6/3/21
to gaura...@emxdigital.com, adwor...@googlegroups.com
Hi Gaurav,

Thanks for clarifying this -- there does not appear to be an Ads API analogue for UseRawEnumValues. With this, I will submit a feature request on your behalf. 

New features are announced on the Ads Developer blog and the release notes.

Regards,

Gaurav Suri

unread,
Jun 7, 2021, 1:08:53 AM6/7/21
to AdWords API and Google Ads API Forum

Thank you for the updates.
Do we have any rough timeline, when this may be available ?

Regards,
Gaurav 

Google Ads API Forum Advisor

unread,
Jun 7, 2021, 9:25:07 PM6/7/21
to gaura...@emxdigital.com, adwor...@googlegroups.com
Hi Gaurav,

I work with Matt and let me provide support to your concern.

I am afraid that our team doesn't have a definite timeline on when this feature will be available. With this, I would suggest also to follow our blog and keep an eye on our Release Notes document as we will post there any updates and new releases for Google Ads API and AdWords API.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2HzWQD:ref

Google Ads API Forum Advisor

unread,
Jun 18, 2021, 6:15:45 PM6/18/21
to gaura...@emxdigital.com, adwor...@googlegroups.com
Hi Gaurav,

Which programming language / client library are you using? The enum values (and not ordinals) are returned by all the client libraries, so I need more details to understand why this issue happens.

Cheers
Anash

ref:_00D1U1174p._5004Q2HzWQD:ref

Gaurav Suri

unread,
Jun 21, 2021, 12:48:54 AM6/21/21
to AdWords API and Google Ads API Forum
Hello Team,

We use the python programming language (client lib - https://github.com/googleads/google-ads-python).
The enum values are definitely returned by all client libraries. However, the adwords api used to return display value of the enum (as visible in the Google Ads Console)
As an example, for Ad Type, the enum returns 'EXPANDED_TEXT_AD'. 
Now in adwords api, using the parameter ' UseRawEnumValues', it used to return 'Expanded text ad', which is the value also displayed in Google Ads console. This is what seems to be not returned in Google Ads API.

Let us know if any additional information is required.

Regards,
Gaurav

Google Ads API Forum Advisor

unread,
Jun 21, 2021, 2:46:34 PM6/21/21
to gaura...@emxdigital.com, adwor...@googlegroups.com
Hi Gaurav,

Thanks for clarifying. We do not plan to support this feature in Google Ads API. You can build your own friendly name mapping for various enum types instead. The reference doc at https://developers.google.com/google-ads/api/reference/rpc/v8/AdTypeEnum.AdType is perhaps a good place to look at to build this mapping.
Reply all
Reply to author
Forward
0 new messages