service.
# Cast to string
customer_id = str(customer_id)
# Create the appropriate service and operation based on entity_type
service = client.get_service("CampaignService")
operation = client.get_type("CampaignOperation")
update = operation.update
update.resource_name = service.campaign_path(
customer_id, campaign_id
)
update.target_roas.target_roas = target_roas
client.copy_from(
operation.update_mask,
protobuf_helpers.field_mask(None, update._pb),
)
response = service.mutate_campaigns(customer_id=customer_id, operations=[operation])
print('Updated campaign %s.' % response.results[0].resource_name)
I am following the references in the google ads API and they suggest to use these code.
Thanks for the help!
Kind regards,