How to update bidding strategy in campaign

125 views
Skip to first unread message

xiaochuan li

unread,
Jul 17, 2024, 5:39:18 AM7/17/24
to Google Ads API and AdWords API Forum
In the UI, I need to modify bidding frequently, which is bidirectional, and I will change one state to another.
Snipaste_2024-07-17_17-29-24.pngSnipaste_2024-07-17_17-29-36.png

But in the api, I can change from maximize conversions to target_cpa. But I can't change it in reverse.https://developers.google.com/google-ads/api/docs/campaigns/bidding/set-bids#remove_bids I learned that I need to set it to Null, but it doesn't work after I set it.
No matter which method I use.
v1
campaign.target_cpa = client.get_type("TargetCpa")
campaign.maximize_conversions = client.get_type("MaximizeConversions")
client.copy_from(
campaign_operation.update_mask,
protobuf_helpers.field_mask(None, campaign._pb)
)
v2
campaign.target_cpa = None
campaign.maximize_conversions = client.get_type("MaximizeConversions")
client.copy_from(
campaign_operation.update_mask,
protobuf_helpers.field_mask(None, campaign._pb)
)

How can I modify the bidding? Can you provide an example?

Thanks

Google Ads API Forum Advisor

unread,
Jul 17, 2024, 11:49:48 AM7/17/24
to clixia...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

You can update the bidding strategy from target_cpa to maximize conversions through the CampaignOperation.update, set the fields of the Campaign as previously described. When updating bids, you only need to include the bids you want to change. Google Ads will update those specific bids without changing, adding, or removing any other bids.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vDjGy:ref" (ADR-00252755)

Thanks,
 
Google Logo Google Ads API Team

 

xiaochuan li

unread,
Jul 17, 2024, 10:42:14 PM7/17/24
to Google Ads API and AdWords API Forum
You misunderstood my meaning.

I know how to update the target_cpa value, but I want to change to a different bidding strategy. I can't find how to remove the target_cpa.
Snipaste_2024-07-18_10-38-33.pngSnipaste_2024-07-18_10-38-25.png

Google Ads API Forum Advisor

unread,
Jul 18, 2024, 6:46:21 AM7/18/24
to clixia...@gmail.com, adwor...@googlegroups.com
Hi,

To remove a bid using the API, you need to update its field to 'null'. Since you have mentioned that you have tried and it doesn't work, please provide us with complete API request and response logs with request-id and request header of removing bid. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vDjGy:ref" (ADR-00252755)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Google Ads API Forum Advisor

unread,
Jul 18, 2024, 6:48:02 AM7/18/24
to clixia...@gmail.com, adwor...@googlegroups.com
Hi,

Please ignore my previous response. To remove a bid using the API, you need to update its field to 'null'. Since you have mentioned that you have tried and it doesn't work, please provide us with complete API request and response logs with request-id and request header of removing bid. 

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can send the details via Reply privately to the author option, or direct private reply to this email.

xiaochuan li

unread,
Jul 18, 2024, 10:49:02 PM7/18/24
to Google Ads API and AdWords API Forum
my code and log
Snipaste_2024-07-19_10-46-58.png
Successful response, but no changes have occurred when viewed through the UI interface

Google Ads API Forum Advisor

unread,
Jul 19, 2024, 7:22:25 AM7/19/24
to clixia...@gmail.com, adwor...@googlegroups.com
Hi,

From the provided screenshot, you have redacted the customer ID, which would be difficult to investigate the issue. In order to assist further, could you provide us with complete API request and response logs with request-id and request header of removing bid without any data redaction in the text file.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the Python guide to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vDjGy:ref" (ADR-00252755)

Thanks,
 
Google Logo Google Ads API Team

 

asif...@instaview365.com

unread,
Jul 19, 2024, 7:49:48 AM7/19/24
to adwor...@googlegroups.com

Dear 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum,


We would like to acknowledge that we have received your request and a ticket has been created.

A support representative will be reviewing your request and will send you a personal response (usually within 24 hours).



Thank you for your patience.


Sincerely,

asif...@instaview365.com

xiaochuan li

unread,
Jul 22, 2024, 6:38:20 AM7/22/24
to Google Ads API and AdWords API Forum

Snipaste_2024-07-22_18-36-50.png

Google Ads API Forum Advisor

unread,
Jul 22, 2024, 11:15:46 AM7/22/24
to clixia...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out to the Google Ads API support team.

We verified the provided logs screenshot and found that you are not providing the required fields in the update operation in the API request as you missed adding the fields of the MaximizeConversions object in the request because in the ‘path’ you added ‘targetCpaMicros’ field. So change the request body in such a way that it contains all the required fields in the request.

I would suggest you refer to the campaigns endpoint to know how to update the campaign via the API. 

This message is in relation to case "ref:!00D1U01174p.!5004Q02vE0SY:ref" (ADR-00258931)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Reply all
Reply to author
Forward
0 new messages