How to loop through and remove url_custom_parameters

28 views
Skip to first unread message

Sam

unread,
May 17, 2020, 1:56:34 AM5/17/20
to AdWords API and Google Ads API Forum
Hi,

Is there any python documentation on how to remove an existing url_custom_parameter for a keyword ad_group_criterion in the google ads api?

I'd like to loop through the url_custom_parameters for each keyword, and remove those that have a certain string in the key. However I don't appear to be able to loop through the url_custom_parameters returned in the message (without converting them to json first) and the url_custom_parameters.remove() seems not to be documented, saying it needs an argument (which is unknown to me).

Thanks for your help

Sam

Sam

unread,
May 18, 2020, 12:55:07 AM5/18/20
to AdWords API and Google Ads API Forum
Just to clarify this question - could someone please provide a brief example of how to remove a url_custom_parameter for an ad_group_criterion in python please?

Thank you

Sam

unread,
May 18, 2020, 3:32:19 AM5/18/20
to AdWords API and Google Ads API Forum

One more update in case anyone looking for this info - I managed to get this working using the reference here: https://developers.google.com/protocol-buffers/docs/reference/python-generated#fields

Understanding .remove() would be useful though!

Thanks

Google Ads API Forum Advisor Prod

unread,
May 18, 2020, 3:34:03 PM5/18/20
to sam....@croud.com, adwor...@googlegroups.com

Hi Sam,

Thanks for reaching out to us. With regards to your concern about remove a url_custom_parameter, you can use AdGroupService with Mutate operation. 

As for the REMOVE operation concern, you can call REMOVE on the custom parameters. If you perform remove() operations, it will remove the whole ad group. You can only remove settings by updating the ad group please refer to this code example

If you can use update_mask on custom_parameters and set the custom_parameters to empty, that would work too. You can find more information on Field Masks here and and code sample to update adgroup.

Let me know if you have any  questions.

Thanks,
Nirmita Patel Google Ads Team


 

ref:_00D1U1174p._5004Q1zpoz8:ref
Reply all
Reply to author
Forward
0 new messages