*Ads* (not adwords) api: how to query for and decode repeated object fields?

54 views
Skip to first unread message

Don Mitchell

unread,
Aug 3, 2018, 10:33:21 AM8/3/18
to AdWords API and Google Ads API Forum
For a field like `ad_group_ad.ad.url_custom_parameters` which is a repeated field of objects, will `GoogleAds.search` return a list of objects if queried like that or does your code need to query `ad_group_ad.ad.url_custom_parameters.key, ad_group_ad.ad.url_custom_parameters.value` and then zip the results?

Fuller example fwiw
```
select ad_group_ad.ad.type, ad_group_ad.ad_group, ad_group_ad.ad.id, ad_group_ad.ad.url_custom_parameters, ad_group_ad.status, ad_group_ad.ad.final_urls
from ad_group_ad where campaign.id = #######
```
In this case, `ad_group_ad.ad.final_urls` comes back as a list of strings, but so far I've not gotten anything back for ad_group_ad.ad.url_custom_parameters

Side beef: I tried many incantations for the `where` clause and kept getting internal errors from google. I tried `ad_group.campaign = resource_name, 
ad_group.campaign.resource_name, ad_group_ad.campaign.resource_name` and kept getting completely unhelpful internal errors.

Teja Makani

unread,
Aug 3, 2018, 4:22:49 PM8/3/18
to AdWords API and Google Ads API Forum
Hello Don,

The ad_group_ad.ad.url_custom_parameters field will populate the list of key-value pair of custom parameters in the urlCustomParameters part of the response. You may not see this parameter in the response if your Ad does not have any custom parameters. I ran a test with the same query mentioned and got the custom parameter shown in the response under "urlCustomParameters", attached request and response REST logs (redacted sensitive data) for your reference. If the problem persists, please share the SOAP logs (request and response) without redacting any data. You could use reply privately to author option while sharing. 

Regards,
Sai Teja, AdWords API Team.
Request and Response logs
Reply all
Reply to author
Forward
0 new messages