How to set bidding strategy to MANUAL_CPC without

122 views
Skip to first unread message

Rukeith Tseng

unread,
Sep 10, 2020, 2:47:06 AM9/10/20
to AdWords API and Google Ads API Forum
Here is my example

```
def main(client, customer_id, campaign_id):
campaign_service = client.get_service("CampaignService", version="v5")
# Create campaign operation.
campaign_operation = client.get_type("CampaignOperation", version="v5")
campaign = campaign_operation.update
campaign.resource_name = campaign_service.campaign_path(
customer_id, campaign_id
)
# campaign.name = '20200817-ru'
campaign.status = client.get_type("CampaignStatusEnum", version="v5").PAUSED
campaign.manual_cpc.enhanced_cpc_enabled = False
fm = protobuf_helpers.field_mask(None, campaign)
campaign_operation.update_mask.CopyFrom(fm)

# Update the campaign.
try:
campaign_response = campaign_service.mutate_campaigns(
customer_id, [campaign_operation]
)
except google.ads.google_ads.errors.GoogleAdsException as ex:
print(
'Request with ID "%s" failed with status "%s" and includes the '
"following errors:" % (ex.request_id, ex.error.code().name)
)
for error in ex.failure.errors:
print('\tError with message "%s".' % error.message)
if error.location:
for field_path_element in error.location.field_path_elements:
print("\t\tOn field: %s" % field_path_element.field_name)
sys.exit(1)

print("Updated campaign %s." % campaign_response.results[0].resource_name)
```

But it doesn't work. How could I set campaign to manual_cpc without enhanced_cpc_enabled?

Google Ads API Forum Advisor Prod

unread,
Sep 11, 2020, 1:16:08 PM9/11/20
to rukeit...@mile.cloud, adwor...@googlegroups.com
Hi Rukeith,

Thanks for reaching out! I see that you are trying to update a campaign to disable enhanced_cpc. For an example on how to update a campaign, you can take a look at this sample code for reference. If you are still unable to update your campaign, please provide the complete detailed logs of the request and response so I can take a closer look. You can see here for our guide on how to enable logging. Please provide this via the Reply privately to author option.

Regards,
Google Logo
Danica
Google Ads API Team
 


ref:_00D1U1174p._5004Q24aEqD:ref

Rukeith Tseng

unread,
Sep 13, 2020, 11:05:56 PM9/13/20
to AdWords API and Google Ads API Forum
Hi, the sample code is on my first post and the code works fine. It didn't show up any error. But the bidding strategy of the campaign didn't change.
I want the campaign's bidding strategy set to this. Manual CPC without enhanced.
截圖 2020-09-14 11.03.30.png

adsapiforumadvisor 在 2020年9月12日 星期六上午1:16:08 [UTC+8] 的信中寫道:

Google Ads API Forum Advisor Prod

unread,
Sep 14, 2020, 3:20:03 PM9/14/20
to rukeit...@mile.cloud, adwor...@googlegroups.com
Hi Rukeith,

If the screenshot is of the results of the API request, it looks like the Enhanced CPC option is not selected, which means the API request managed to set enhanced_cpc_enabled to false. If the screenshot is not of the results, I will need you to provide your customerClientId and the campaign ID that is not getting updated from your request. It would be best if you can provide the detailed logs so that I have all the information about your request needed to further analyze the issue. Please provide all this information via the Reply privately to author option.

Rukeith Tseng

unread,
Oct 28, 2020, 5:40:16 AM10/28/20
to AdWords API and Google Ads API Forum
I have posted the issue on GitHub. Any on one response??
Does it have any info?
adsapiforumadvisor 在 2020年9月15日 星期二上午3:20:03 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages