*Dear Google Ads Support Team,*

I am experiencing an issue while attempting to create a *Demand Gen 
Campaign* using the Google Ads API. The campaign budget and bidding 
strategy were created successfully, but I am encountering an error when 
trying to create the campaign itself, specifically with the *bidding 
strategy*.
Below are the details: *1. Creating Campaign Budget:* 

*Request:*

curl --request POST \ 
'https://googleads.googleapis.com/v19/customers/xxxxxxxx/campaignBudgets:mutate?key=[YOUR_API_KEY]'
 
\ --header 'developer-token: **********************' \ --header 
'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \ --header 'Accept: 
application/json' \ --header 'Content-Type: application/json' \ --data 
'{"operations":[{"create":{"name":"Budget Demand Gen 
#1","deliveryMethod":"STANDARD","amountMicros":500000}}]}' \ --compressed 

*Response:*
{ "results": [ { "resourceName": 
"customers/xxxxxxxx/campaignBudgets/xxxxxxxx" } ] }
*2. Creating Bidding Strategy:* 

*Request:*

curl --request POST \ 
'https://googleads.googleapis.com/v19/customers/xxxxxxxx/biddingStrategies:mutate?key=[YOUR_API_KEY]'
 
\ --header 'developer-token: **********************' \ --header 
'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \ --header 'Accept: 
application/json' \ --header 'Content-Type: application/json' \ --data 
'{"operations":[{"create":{"name":"Bidding For Demand Gen 
#1","maximizeConversions":{"cpcBidCeilingMicros":200000}}}]}' \ 
--compressed 

*Response:*

{ "results": [ { "resourceName": 
"customers/xxxxxxxx/biddingStrategies/xxxxxxxx" } ] } 
*3. Creating Campaign (Issue Occurs Here):* 

*Request:*

curl --request POST \ 
'https://googleads.googleapis.com/v19/customers/xxxxxxxx/campaigns:mutate?key=[YOUR_API_KEY]'
 
\ --header 'developer-token: **********************' \ --header 
'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \ --header 'Accept: 
application/json' \ --header 'Content-Type: application/json' \ --data 
'{"operations":[{"create":{"name":"Hypeddit Demand Gen Campaign : 
35904","advertisingChannelType":"DEMAND_GEN","status":"PAUSED","startDate":"20250426","endDate":"20250525","campaignBudget":"customers/xxxxxxxx/campaignBudgets/xxxxxxxx","biddingStrategy":"customers/xxxxxxxx/biddingStrategies/xxxxxxxx"}}]}'
 
\ --compressed 

*Response:*

{ "error": { "code": 400, "message": "Request contains an invalid 
argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": 
"type.googleapis.com/google.ads.googleads.v19.errors.GoogleAdsFailure", 
"errors": [ { "errorCode": { "contextError": 
"OPERATION_NOT_PERMITTED_FOR_CONTEXT" }, "message": "The operation is not 
allowed for the given context.", "trigger": { "int64Value": "11537883468" 
}, "location": { "fieldPathElements": [ { "fieldName": "operations", 
"index": 0 }, { "fieldName": "create" }, { "fieldName": "bidding_strategy" 
} ] } } ], "requestId": "2Jvkns8NRxcMZmSdGu7ynw" } ] } } 
*Error Explanation:* 
   
   - 
   
   *Error Code*: INVALID_ARGUMENT
   - 
   
   *Message*: "Request contains an invalid argument."
   - 
   
   *Details*: "The operation is not allowed for the given context."
   - 
   
   *Field*: bidding_strategy
   - 
   
   *Trigger*: 11537883468 (Bidding Strategy resource name)
   
It seems that the *bidding strategy* is not valid for the *Demand Gen 
campaign type*. I have confirmed that both the *campaign budget* and *bidding 
strategy* are being created successfully in separate API calls, but the 
issue arises when I attempt to assign the *bidding strategy* to the 
campaign in the final step.

Could you please advise on:

   1. 
   
   The *correct way* to assign a *bidding strategy* to a *Demand Gen 
   campaign*.
   2. 
   
   If there are any additional constraints or requirements for *Demand Gen 
   campaigns* regarding bidding strategies.
   
Thank you for your assistance, and I look forward to your response.

Best regards,

Ashish

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/b39f6401-71c7-4215-b36e-91901b4c7e7en%40googlegroups.com.

Reply via email to