Setting Campaign Bidding Strategy with REST (Ads API)

89 views
Skip to first unread message

Jonathan Faircloth

unread,
Feb 26, 2019, 5:04:54 PM2/26/19
to AdWords API and Google Ads API Forum
Is there a way to set the campaign bidding strategy to Maximize Conversions using a REST request? Manual CPC, Target ROAS and every other type that has children listed here work fine. But, maximize_conversions says the type is "Message" and nothing seems to work in that field. I've tried numbers, booleans, objects, arrays, strings, everything. But nothing seems to work to set Maximize Conversions as the bidding strategy. What type of data is the server expecting when the reference says the type is "Message"?

googleadsapi...@google.com

unread,
Feb 27, 2019, 2:20:23 PM2/27/19
to AdWords API and Google Ads API Forum
Hello Jonathan, 

You may use the CampaignService and perform the MutateCampaignsRequest to set the Bidding strategy. Please find the code snippet below as an example:

Campaign campaign = 
Campaign.newBuilder() 
.setName(StringValue.of("Interplanetary Cruise #" + System.currentTimeMillis())) 
.setAdvertisingChannelType(AdvertisingChannelType.SEARCH)
.setStatus(CampaignStatus.PAUSED) 
.setMaximizeConversions(MaximizeConversions.newBuilder().build()) 
.setCampaignBudget(StringValue.of(budgetResourceName)) 
.setNetworkSettings(networkSettings) 
.setStartDate(StringValue.of(new DateTime().plusDays(1).toString("yyyyMMdd"))) 
.setEndDate(StringValue.of(new DateTime().plusDays(30).toString("yyyyMMdd"))) 
.build(); 

CampaignOperation op = CampaignOperation.newBuilder().setCreate(campaign).build(); 
operations.add(op);

The code snippet is for testing in Java. Could you please give this a try and let me know if you have any issues?

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Jonathan Faircloth

unread,
Feb 27, 2019, 9:21:51 PM2/27/19
to AdWords API and Google Ads API Forum
Thanks for the reply. My question isn’t about a specific library. I guess a better way to word it might be: when the code snippet you posted is executed, what does the POST body that is sent to the API actually look like? Like if I were creating a new campaign set to manual cpc just using the REST API and Curl the body for my request might look something like this:

{
"name": "Test",
"status": "PAUSED",
"budget_id": "1734429035",
"advertising_channel_type": "SEARCH",
"manual_cpc": {
"enhanced_cpc_enabled": true
}
}

How would it look if I were trying to set it to maximize conversions?

Thanks for your help.

googleadsapi...@google.com

unread,
Feb 28, 2019, 3:49:37 PM2/28/19
to AdWords API and Google Ads API Forum
Hello Jonathan, 

Please find the attached sample request and response logs from the shared request. Could you please take a look and let us know if this addressed your concern? 

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Sample_logs.rtf

Jonathan Faircloth

unread,
Feb 28, 2019, 4:16:36 PM2/28/19
to AdWords API and Google Ads API Forum
Yep that’s perfect. Thank you so much for the help.
Reply all
Reply to author
Forward
0 new messages