Changing Max CPC Bid Manually by Keyword (Google Ads API Beta) using Python

62 views
Skip to first unread message

Andrew Lee

unread,
Jun 29, 2020, 7:43:06 AM6/29/20
to AdWords API and Google Ads API Forum
Hi,

I am trying to setup a script that manually changes the Max CPC by keyword using the Google Ads API Beta v3. The only thing I can do is change the max cpc bid by ad group, which changes all the bid amounts for every keyword to the same bid. Is there any way to do this by keyword id????? Here is what I tried using the AdGroupCriterionService but it does not work at all for the max cpc bid. 

    ga_service = client.get_service('GoogleAdsService'version='v3')
    agc_service = client.get_service('AdGroupCriterionService'version='v3')
    ad_group_criterion_operation = client.get_type('AdGroupCriterionOperation',
                                                   version='v3')
    criterion_id = '10387347805'
ad_group_criterion = ad_group_criterion_operation.update
    ad_group_criterion.resource_name = agc_service.ad_group_criteria_path(
                customer_id, ResourceName.format_composite(ad_group_id, criterion_id))
    ad_group_criterion.status = (client.get_type('AdGroupCriterionStatusEnum',
                                                             version='v3')
                                          .ENABLED)
    ad_group.cpc_bid_micros_value = bid
    fm = protobuf_helpers.field_mask(None, ad_group_criterion)
    ad_group_criterion_operation.update_mask.CopyFrom(fm)
    agc_response = agc_service.mutate_ad_group_criteria(
                  customer_id, [ad_group_criterion_operation])

It does not make sense that we can't manually change max cpc by keyword. It literally defeats the purpose of automating things using the API.
Any help is much appreciated though. Thanks.

Google Ads API Forum Advisor Prod

unread,
Jun 29, 2020, 12:33:54 PM6/29/20
to alee...@gmail.com, adwor...@googlegroups.com
Hi Andrew,

Thank you for reaching out. It is possible to set the keyword level CPC bid by using the AdGroupCriterionService and setting the cpc_bid_micros value of the AdGroupCriterion. However, please make sure that the campaign the keywords belong to is a search campaign with a manual bid strategy since these will be the only keywords that have a max cpc value that you can set. If you can set the keyword CPC value for a specific keyword in the UI then you can set it in the API.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q21A9Ry:ref

Andrew Lee

unread,
Jun 29, 2020, 5:54:17 PM6/29/20
to AdWords API and Google Ads API Forum
Mitchell,

Changing the ad_group_criterion.cpc_bid_micros value only changes the cpc value not the max cpc bid which is in the ad group level. The cpc bid in ad group criterion is a metric not a configuration.

But what doesn't make sense to me is ad group level is an attribute of ad group criterion but I can't change the cpc micro for ad grouo through the ad grouo criterion service. The criterion service is the only place to make changes by keyword id for each ad group and the ad group service is the only place to make changes to the max cpc bid.

Is there any way to change MAX CPC BID by criterion ID by ad group????

cpc micro through criterion service does not change the MAX CPC BID.

Your help is much appreciated.

Thanks.

Google Ads API Forum Advisor Prod

unread,
Jun 30, 2020, 10:21:28 AM6/30/20
to alee...@gmail.com, adwor...@googlegroups.com
Hi Andrew,

The ad_group_criterion.cpc_bid_micros value will change the Max CPC of the specific keyword (or other criterion). If you want to change the max CPC of the entire ad group, you have to do this through the AdGroupService since that service handles changes to the ad group itself.

I'm not exactly sure what you mean by "ad group level is an attribute of ad group criterion". The AdGroupCriterionService only makes changes for the ad group criteria and not for the ad group as a whole.

If this still doesn't answer your question, please share a screenshot of the UI showing metric you are trying to change via Reply privately to author so I can further investigate the issue.

Andrew Lee

unread,
Jun 30, 2020, 7:54:58 PM6/30/20
to AdWords API and Google Ads API Forum
Thanks Mitchell. I think I figured it out. The the Max CPC changes from the ad group service changes the default bid and the CPC changes through the ad group criterion service changes the it at the keyword level I believe. I hope this helps other people.

Thanks again,

Andrew
Reply all
Reply to author
Forward
0 new messages