Recommendation Type Enum Doesn't Match Results

64 views
Skip to first unread message

Scott Vaillancourt

unread,
Mar 1, 2021, 6:39:02 PM3/1/21
to AdWords API and Google Ads API Forum
It looks like a new recommendation type has been added but not yet reflected in the Enum. Specifically, the value 18 (RESPONSIVE_SEARCH_AD?) is being returned from a query but isn't part of the Enum. However, it does appear in the documentation (https://developers.google.com/google-ads/api/reference/rpc/v6/RecommendationTypeEnum.RecommendationType). 

I've pasted in some code/results below that illustrate the issue. Thanks.

Scott

In [22]: rtenum = client.get_type("RecommendationTypeEnum", version="v6")                                                                                                 

In [23]: rtenum.RecommendationType.values()                                                                                                                               

Out[23]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]

In [24]: rtenum.RecommendationType.keys()                                                                                                                                 

Out[24]: 

['UNSPECIFIED',

 'UNKNOWN',

 'CAMPAIGN_BUDGET',

 'KEYWORD',

 'TEXT_AD',

 'TARGET_CPA_OPT_IN',

 'MAXIMIZE_CONVERSIONS_OPT_IN',

 'ENHANCED_CPC_OPT_IN',

 'SEARCH_PARTNERS_OPT_IN',

 'MAXIMIZE_CLICKS_OPT_IN',

 'OPTIMIZE_AD_ROTATION',

 'CALLOUT_EXTENSION',

 'SITELINK_EXTENSION',

 'CALL_EXTENSION',

 'KEYWORD_MATCH_TYPE',

 'MOVE_UNUSED_BUDGET',

 'FORECASTING_CAMPAIGN_BUDGET',

 'TARGET_ROAS_OPT_IN']

In [25]: query = ''' 

    ...:     SELECT 

    ...:         recommendation.type 

    ...:     FROM recommendation'''                                                                                                                                       

In [26]: gas = client.get_service('GoogleAdsService', version='v6')                                                                                                      

In [27]: resp = gas.search(cid, query)                                                                                                                                    

In [28]: rtypes = []                                                                                                                                                      

In [29]: for row in resp: 

    ...:     rtypes.append(row.recommendation.type)                                                                                                                                                              

In [30]: rtypes                                                                                                                                                          

Out[30]: [2, 12, 12, 13, 13, 13, 5, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18]



Scott Vaillancourt

unread,
Mar 1, 2021, 7:03:08 PM3/1/21
to AdWords API and Google Ads API Forum
Quick update: I also encountered this issue with the ChangeEventResourceType enum.

Scott

Google Ads API Forum Advisor Prod

unread,
Mar 2, 2021, 2:52:28 PM3/2/21
to sc...@lionhurst.com, adwor...@googlegroups.com

Hi Scott,

Thank you for reaching out. Please look into the v6 RecommendationTypeEnum. You would be able to see the number 18 represents RESPONSIVE_SEARCH_AD.

Thanks and regards,
Xiaoming, Google Ads API Team
 


Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DKDQc:ref

Scott Vaillancourt

unread,
Mar 2, 2021, 3:44:20 PM3/2/21
to AdWords API and Google Ads API Forum
Hi Xiaoming,

Thanks for your reply. I believe I am accessing the correct enum, but it doesn't appear to contain the value 18. Please see the code below. Thanks.

Scott

In [50]: rte = client.get_type("RecommendationTypeEnum", version="v6") 

    ...: rtype = zip(rte.RecommendationType.values(), rte.RecommendationType.keys()) 

    ...: for r in rtype: 

    ...:     print(r)                                                                                                                                                                

(0, 'UNSPECIFIED')

(1, 'UNKNOWN')

(2, 'CAMPAIGN_BUDGET')

(3, 'KEYWORD')

(4, 'TEXT_AD')

(5, 'TARGET_CPA_OPT_IN')

(6, 'MAXIMIZE_CONVERSIONS_OPT_IN')

(7, 'ENHANCED_CPC_OPT_IN')

(8, 'SEARCH_PARTNERS_OPT_IN')

(9, 'MAXIMIZE_CLICKS_OPT_IN')

(10, 'OPTIMIZE_AD_ROTATION')

(11, 'CALLOUT_EXTENSION')

(12, 'SITELINK_EXTENSION')

(13, 'CALL_EXTENSION')

(14, 'KEYWORD_MATCH_TYPE')

(15, 'MOVE_UNUSED_BUDGET')

(16, 'FORECASTING_CAMPAIGN_BUDGET')

(17, 'TARGET_ROAS_OPT_IN')


Google Ads API Forum Advisor Prod

unread,
Mar 2, 2021, 4:05:55 PM3/2/21
to sc...@lionhurst.com, adwor...@googlegroups.com

Hi Scott,

Thank you for reaching out. The RESPONSIVE_SEARCH_AD type actually exists in these client libraries. If you are using the Python client library, you could refer to this line of code.



Thanks and regards,
Xiaoming, Google Ads API Team
 

Scott Vaillancourt

unread,
Mar 2, 2021, 4:13:09 PM3/2/21
to AdWords API and Google Ads API Forum
Thank you. After looking at the links you sent and digging into it a bit more, it appears to be a version problem. I downloaded the most current edition of google-ads (which I should have done straight away), at that has resolved the issue.

Scott

Reply all
Reply to author
Forward
0 new messages