Structuring location exclusion requests for Demand Gen campaigns

139 views
Skip to first unread message

Roger Smith

unread,
Dec 18, 2024, 5:46:53 PM12/18/24
to Google Ads API and AdWords API Forum
Hi,

I need to understand whether there is a specific service or route for excluding locations in demand gen campaigns via the Google Ads API. I currently have a "normal" operation for excluding these locations in app, search and display campaigns that is working correctly. However, when I use this same operation for demand gen campaigns I get the following error:

The error code is not in this version., at operations[0].create.location
OWNED_AND_OPERATED referenced in error details

This is the operation used:

{
    "create": {
        "campaign": f"customers/{customer_id}/campaigns/{campaign_id}",
        "negative": True,
        "type_": "LOCATION",
        "location": {"geo_target_constant": location_id}
    }
}

How should I create operations instead?

Google Ads API Forum Advisor

unread,
Dec 18, 2024, 10:48:54 PM12/18/24
to acol...@gmail.com, adwor...@googlegroups.com
Hi,

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

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 and exclude the locations. 

You can 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 location exclusions are targeted using the campaignCriteria method, which results in receiving 'OWNED_AND_OPERATED' error. In the other campaign, where location and language settings are applied at the campaign level, no errors are encountered when targeting location exclusions using the campaignCriteria method.

If you still face any issues, then share us the Google Ads account ID and the campaign ID so that we can check and confirm if your campaign criteria is created at the campaign level or the ad group level.  

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGped:ref" (ADR-00279202)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


Screenshot 2024-12-19 9.10.02 AM.png
Screenshot 2024-12-19 9.13.02 AM.png

Roger Smith

unread,
Dec 19, 2024, 2:00:16 AM12/19/24
to Google Ads API and AdWords API Forum
You're a super hero. What a lightning speed reaction and so much details too. I struggled with this for 4 hours yesterday.  That makes so much sense! I now made the adjustments. I had to add a couple of new methods to fetch upgraded_targeting status, and an ad group ID iterator and use AdGroupCriterionService but it's working :) Thank you

For anyone that's Googling in the future (like me)

  • For standard (non demand gen) campaigns and demand gen campaigns with upgraded targeting set to false:
    • Creates campaign-level exclusion operations
    • Apply exclusions using CampaignCriterionService
  • For Demand Gen campaigns with upgraded targeting set to true:
    • Retrieve all ad groups in the campaign
    • Create ad group-level exclusion operations
    • Apply exclusions using AdGroupCriterionService

Reply all
Reply to author
Forward
0 new messages