Adding Google Hotels campaign bidding strategy via REST/JSON

52 views
Skip to first unread message

Steve Wilcox

unread,
Jan 5, 2021, 6:08:22 PM1/5/21
to AdWords API and Google Ads API Forum
Greetings forum faithful!

I'm adding campaigns via the API.  I'm able to add display and search campaigns no problem.  When I try to add Hotels campaigns, though, I get 

"message": "The required field was not present.", "trigger": { "stringValue": "" }, "location": { "fieldPathElements": [ { "fieldName": "operations", "index": "0" }, { "fieldName": "create" }, { "fieldName": "campaign_bidding_strategy" } 

I don't have that field.  What is it supposed to look like?

Let's say I'm using a manual_cpc strategy. 

Google Ads API Forum Advisor Prod

unread,
Jan 6, 2021, 4:53:34 AM1/6/21
to swi...@convoyant.com, adwor...@googlegroups.com
Hi Steve,

Thank you for reaching out.

You can refer to this (https://googleads.googleapis.com/$discovery/rest?version=v6) documentation on how to implement your REST requests such as the field naming conventions you will need to use. In the said document the "manualCpc" was used.

Let me know if this helps.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2AHkmc:ref

Steve Wilcox

unread,
Jan 6, 2021, 11:28:52 AM1/6/21
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com
Peter,

Thanks for your reply!

Here's the JSON I'm sending currently:

{
  "operations": [
    {
      "create": {
        "name": "RN_Hotel_20210105214252_test2",
        "status": 3,
        "campaignBudget": "customers/<customerID>/campaignBudgets/<budgetid>",
        "advertisingChannelType": 5,
        "campaign_bidding_strategy": {
          "type": "MANUAL_CPC",
          "enhanced_cpc_enabled": false
        }
      }
    }
  ]
}


This is what I get back:

    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "operations[0].create",
            "description": "Invalid JSON payload received. Unknown name "campaign_bidding_strategy" at 'operations[0].create': Cannot find field."
The docs don't give a super specific name for the field.  What should I be using instead?
--
Steve Wilcox
Developer | ResNexus

Google Ads API Forum Advisor Prod

unread,
Jan 7, 2021, 2:35:28 AM1/7/21
to swi...@convoyant.com, adwor...@googlegroups.com
Hi Steve,

You can follow the example here where it used the target_spend directly, also in the documentation, you can use "manualCpc", for implementing a standard strategy :

"manualCpc": { "description": "Standard Manual CPC bidding strategy. Manual click-based bidding where user pays per click.", "$ref": "GoogleAdsGoogleadsV6Common__ManualCpc" }
Reply all
Reply to author
Forward
0 new messages