Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Unable to create demand gen campaign on total budget

104 views
Skip to first unread message

Aman Ansari

unread,
May 2, 2025, 4:42:12 AMMay 2
to Google Ads API and AdWords API Forum
Hi,
I want to create demand gen campaign on total budget using google ads API. However I can’t find any reference in doc, kindly let me if it’s I can do so using API.

Google Ads API Forum Advisor

unread,
May 2, 2025, 9:45:42 AMMay 2
to ansar...@gmail.com, adwor...@googlegroups.com

Hi,

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

Yes, it is possible to create a demand gen campaign using the Google Ads API. You can achieve this by utilizing the customers.campaigns method.

For step-by-step instructions on how to set up campaigns via the API, I recommend referring to the Campaign Creation guide. This guide provides detailed instructions and examples to walk you through the process. Also, you can explore the various supported campaign types and their specific configurations in our campaign types documentation.

To create a demand gen campaign using Google Ads API, firstly you need to set up a campaign budget via API. I would recommend you to go sample code to achieve campaign budget and campaign creation:

POST https://googleads.googleapis.com/v19/customers/7596015003/campaignBudgets:mutate?key=[YOUR_API_KEY] HTTP/1.1

{

  "operations": [

    {

      "create": {

        "name": "campaignBudget",

        "amountMicros": 100000

      }

    }

  ]

}
POST https://googleads.googleapis.com/v19/customers/7596015003/campaigns:mutate?key=[YOUR_API_KEY] HTTP/1.1

{

  "operations": [

    {

      "create": {

        "name": "Test1",

        "advertisingChannelType": "DEMAND_GEN",

        "campaignBudget": "customers/7596015003/campaignBudgets/14524648553",

        "targetCpa": {

          "targetCpaMicros": 10000

        } 
     }
   } 
  ]
}

 

If you are facing any issues while creating campaign, kindly get back to us.

Thanks,

Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-05-02 13:44:27Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01qVew5:ref" (ADR-00303358)

 



Aman Ansari

unread,
May 3, 2025, 10:00:10 AMMay 3
to Google Ads API and AdWords API Forum
Hi,
This is not what I am referring to. I can create a demand gen campaign with a daily budget, but I want to create it with a total budget. I have attached an image for reference.  

campaign-total-budget.png

Google Ads API Forum Advisor

unread,
May 5, 2025, 2:19:04 AMMay 5
to ansar...@gmail.com, adwor...@googlegroups.com

Hi,

I would suggest exploring the campaign_budget.total_amount_micros field. This field represents the lifetime amount of the budget, in the local currency for the account. Amount is specified in micros, where one million is equivalent to one currency unit.

Additionally, I recommend referring to the About campaign total budgets help center article for more information.

To better assist you further, could you please provide an uncropped screenshot of your Google Ads UI? Please ensure the screenshot clearly shows your Google Ads customer ID and highlights the specific budget setting you are referring to. 

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


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-05-05 06:17:53Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01qVew5:ref" (ADR-00303358)



Rondale Sidbury

unread,
May 5, 2025, 3:13:39 AMMay 5
to Google Ads API and AdWords API Forum
sure

Aman Ansari

unread,
May 6, 2025, 3:57:54 AMMay 6
to rondale...@gmail.com, Google Ads API and AdWords API Forum
This is now working, also can you help me with countries targeted campaign. I want create demand gen campaign with targeted countries.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "Google Ads API and AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/p0YbmgAXDIs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/adwords-api/67f1a726-da3f-405b-be99-2bab5b54b640n%40googlegroups.com.

Aman Ansari

unread,
May 6, 2025, 3:58:31 AMMay 6
to Google Ads API and AdWords API Forum
This is now working, also can you help me with countries targeted campaign. I want create demand gen campaign with targeted countries.

Google Ads API Forum Advisor

unread,
May 6, 2025, 6:19:40 AMMay 6
to ansar...@gmail.com, adwor...@googlegroups.com

Hi,

Before targeting your demand Gen campaign with the targeted countries you need to check your Demand Gen campaign to see if the location and language settings are configured at the ad group level or campaign level within the campaign settings page. For reference, I have attached two sample screenshots. In one campaign, the location and language settings are applied at the ad group level, and if the locations are targeted using the campaignCriteria method, you will be receiving 'OWNED_AND_OPERATED' error. In the campaign, where location and language settings are applied at the campaign level, no errors are encountered when targeting location using the campaignCriteria method. 

Kindly note that when you set the upgraded_targeting field to 'true' for the demand gen campaign then the location and language targeting are managed at the ad group level rather than the campaign level. If you don't set this field then it will be defaulted to true. Since location and language targeting are applied at the ad group level, you will need to use the adGroupCriteria method to exclude the locations, rather than the campaignCriteria method. When you try to use the campaignCriteria method you will encounter an 'OWNED_AND_OPERATED' error.  Also, upgraded_targeting is immutable, meaning it cannot be modified once set. The only possible way to avoid the error is you would need to create a new campaign with upgraded_targeting set to 'false', allowing you to use the campaignCriteria method to target the location at the campaign level or to use the adGroupCriteria method to target the locations. 

If location and language settings of your Demand Gen campaign are configured at the campaign level, I would recommend you to use the campaignCriteria method to target the locations for your campaign and refer to the sample request, response logs as shared below: 

Request Body:
===============
POST https://googleads.googleapis.com/v19/customers/{customerId}/campaignCriteria:mutate?key=[YOUR_API_KEY] HTTP/1.1

developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "operations": [
    {
      "create": {
        "campaign": "customers/{customerId}/campaigns/{campaignId}",
        "location": {
          "geoTargetConstant": "geoTargetConstants/2012"
        }
      }
    }
  ]
}
Response:
==========
HTTP/1.1 200 
content-encoding: gzip
content-length: 120
content-type: application/json; charset=UTF-8
date: Tue, 06 May 2025 09:52:28 GMT
server: ESF
vary: Origin, X-Origin, Referer

{
  "results": [
    {
      "resourceName": "customers/{customerId}/campaignCriteria/{campaignId}~2012"
    }
  ]
}

If location and language settings of your Demand Gen campaign are configured at the adGroup level, I would recommend you to use the adGroupCriteria method to target the locations for your campaign and refer to the sample request, response logs as shared below: 

Request Body:
===============
POST https://googleads.googleapis.com/v19/customers/{customerId}/adGroupCriteria:mutate?key=[YOUR_API_KEY] HTTP/1.1

developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "operations": [
    {
      "create": {
        "adGroup": "customers/{customerId}/adGroups/{adGroupId}",
        "location": {
          "geoTargetConstant": "geoTargetConstants/2040"
        }
      }
    }
  ]
}
Response:
==========
HTTP/1.1 200 
content-encoding: gzip
content-length: 120
content-type: application/json; charset=UTF-8
date: Tue, 06 May 2025 09:56:06 GMT
server: ESF
vary: Origin, X-Origin, Referer

{
  "results": [
    {
      "resourceName": "customers/{customerId}/adGroupCriteria/{adGroupId}~2040"
    }
  ]
}

I would recommend you to refer to the Criteria documentation for more detailed information.

I hope this clarifies. 


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-05-06 10:18:21Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01qVew5:ref" (ADR-00303358)



Screenshot 2025-05-06 3.16.03 PM.png
Screenshot 2025-05-06 3.15.55 PM.png
Reply all
Reply to author
Forward
0 new messages