Changing Standard Bidding Strategy Type using API

67 views
Skip to first unread message

Muthu Qumar Subramanian

unread,
Nov 24, 2021, 10:31:17 AM11/24/21
to AdWords API and Google Ads API Forum
Hi, 

I am trying to change the bidding strategy type of a campaign through API call. My campaign currently has a MANUAL_CPC Bidding strategy and I am trying to change it to TARGET_SPEND (Standard Bidding Strategy). I set the bidding strategy type field and target spend in Campaign Object. 
My campaign Operation looks like below: 

CampaignOperation campaignOperation =
CampaignOperation.newBuilder()
.setUpdateMask(
FieldMasks.compare(originalCampaignObject, modifiedCampaignObject)
)
.setUpdate(modifiedCampaignObject)
.build();

campaignMutateOperation =
MutateOperation.newBuilder().setCampaignOperation(campaignOperation).build();


My update Mask being set: 
 update_mask {
      paths: "bidding_strategy_type"
      paths: "end_date"
      paths: "manual_cpc"
      paths: "target_spend.cpc_bid_ceiling_micros"
    }

The mutate operation results in an error: com.google.ads.googleads.v8.errors.GoogleAdsException: errors {
  error_code {
    field_error: FIELD_CANNOT_BE_CLEARED
  }
  message: "The field cannot be cleared."
  location {
    field_path_elements {
      field_name: "mutate_operations"
      index: 0
    }
    field_path_elements {
      field_name: "campaign_operation"
    }
    field_path_elements {
      field_name: "update"
    }
    field_path_elements {
      field_name: "manual_cpc"
    }
  }
}
request_id: "_jWLPtoRuadB680s-eYsMg"

Is there anything I am missing here to update a campaign's standard bidding strategy type from Manual Cpc to Target Spend. 

Cheers, 
Muthu Qumar S

Google Ads API Forum Advisor

unread,
Nov 25, 2021, 4:18:41 AM11/25/21
to muthu.su...@cloudsense.com, adwor...@googlegroups.com

Hi Muthu,

 

Thank you for reaching out to the Google Ads API Team.

 

Can you please provide the complete request and response logs with request ID so I can take a closer look at the issue? Here's our guide on updating a campaign's bidding strategy just for reference. You can send these to me via Reply privately to author option. If this option is not available to you, you may send it directly to googleadsa...@google.com, just let us know once you have sent it so we can check it on our end.

 

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 

Google Logo
Kevin Gil Soriano
Google Ads API Team
 


ref:_00D1U1174p._5004Q2RvwiU:ref
Reply all
Reply to author
Forward
0 new messages