Hi,
This is a question about Google Ads API and for Python.
I am trying to mutate a campaign bid modifier using
'CampaignBidModifierOperation'.and 'CampaignBidModifierService'. Upon
providing a resource name, in the format
'customers/{customer_id}/campaignBidModifiers/{campaign_id}~{criterion_id}'
I get this error 'Resource name not found'. The resource I definitely
extracted during a query to view all campaign bid modifier resource names.
The login_customer_id is a manager account id we use in our google
credentials.
Here is the code:
# cbm is short for campaign bid modifier
customer_id = '' # Add customer id here
criterion_id = '' # Add criterion id here
campaign_id = '' # Add campaign id here
LOGIN_CUSTOMER_ID = '' # MCC Account ID typically imported
client = google_ads_client()
client.login_customer_id = LOGIN_CUSTOMER_ID
cbm_service = client.get_service('CampaignBidModifierService',
version='v2')
cbm_operation = client.get_type('CampaignBidModifierOperation',
version='v2')
cbm = cbm_operation.update
cbm.resource_name =
'customers/{}/campaignBidModifiers/{}~{}'.format(customer_id, campaign_id,
criterion_id)
cbm.bid_modifier.value = .97
# Retrieve a FieldMask for the fields configured in the campaign.
fm = protobuf_helpers.field_mask(None, cbm)
cbm_operation.update_mask.CopyFrom(fm)
cbm_response = cbm_service.mutate_campaign_bid_modifiers(
customer_id, [cbm_operation])
print('Updated campaign %s.' % cbm_response.results[0].resource_name)
I hope someone can help. Perhaps I am not using this api correctly.
Thank you!
-Deb
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/d948f885-9060-46c5-aa09-095a97a1ac71%40googlegroups.com.