Hi
I saw this [code][1] for bulk creating ad groups.
I want to write similar code for bulk removing ads.
Is my modification correct?
def build_ad_removal_sync_operation(customer_id, campaign_id, ad_id):
resource_name =
serviceWrapper.ad_group_ad_service.ad_group_ad_path(customer_id,
campaign_id, ad_id)
ad_group_ad_op1 =
serviceWrapper.client.get_type("AdGroupAdOperation")
ad_group_ad_op1.remove.name = f"Remove ad:
{customer_id}/{campaign_id}/{ad_id}"
ad_group_ad_op1.remove.ad = resource_name
return ad_group_ad_op1
def send_bulk_mutate_request(customer_id, operations):
# Issue a mutate request, setting partial_failure=True.
request = serviceWrapper.client.get_type("MutateAdGroupsAdRequest")
request.customer_id = customer_id
request.operations = operations
request.partial_failure = True
return
serviceWrapper.ad_group_ad_service.mutate_ad_groups(request=request)
Thanks!
(also posted on the python api github
<https://github.com/googleads/google-ads-python/issues/494>)
[1]:
https://github.com/googleads/google-ads-python/blob/b0403e0891c11f9c8aa54d0c28455c8a0502ccd5/examples/error_handling/handle_partial_failure.py
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/134f1e42-56f5-4fbd-ab5d-a0fa2d27a0d4n%40googlegroups.com.