googleAds:mutate campaignCriterionOperation throwing INCONSISTENT_FIELD_VALUES error

268 views
Skip to first unread message

Dan Charbonneau

unread,
Jun 12, 2024, 12:44:41 PM6/12/24
to Google Ads API and AdWords API Forum
New to these APIs and I've spent a day searching the conversations and can't understand what the fields are mis-matched in my googleAds:mutate campaignCriterionOperation.

I get this error if I join the campaignCriterion with "language" or "location", but works with things like "keyword".

Here is an example of language criterion, scoped it down to just campaign.

Endpoint:

Request Body:
{
"mutateOperations": [
{
"campaignBudgetOperation": {
"create": {
"resourceName": "customers/{{googAccountId}}/campaignBudgets/-1",
"deliveryMethod": "STANDARD",
"period": "DAILY",
"type": "STANDARD",
"name": "API RDA Keyword to website #6 Campaign Budget",
"amountMicros": 5000000,
"explicitlyShared": false
}
}
},
{
"campaignOperation": {
"create": {
"resourceName": "customers/{{googAccountId}}/campaigns/-2",
"status": "ENABLED",
"advertisingChannelType": "SEARCH",
"name": "API RDA Keyword to website #6 Campaign",
"campaignBudget": "customers/{{googAccountId}}/campaignBudgets/-1",
"networkSettings": {
"targetGoogleSearch": true,
"targetSearchNetwork": true,
"targetContentNetwork": false,
"targetPartnerSearchNetwork": false,
"targetYoutube": false,
"targetGoogleTvNetwork": false
},
"frequencyCaps": [
{
"key": {
"level": "AD_GROUP",
"eventType": "IMPRESSION",
"timeUnit": "DAY",
"timeLength": 1
},
"cap": 2
}
],
"paymentMode": "CLICKS",
"assetAutomationSettings": [
{
"assetAutomationType": "TEXT_ASSET_AUTOMATION",
"assetAutomationStatus": "OPTED_OUT"
}
],
"manualCpc": {
"enhancedCpcEnabled": true
}
}
}
},
{
"campaignCriterionOperation": {
"create": {
"resourceName": "customers/{{googAccountId}}/campaignCriteria/-2~-7",
"status": "ENABLED",
"campaign": "customers/{{googAccountId}}/campaigns/-2",
// "bidModifier": number,
"negative": false,
"language": {
"languageConstant": "languageConstants/1000"
}
// "location": {
// "geoTargetConstant": "geoTargetConstants/2840"
// }
// "keyword": {
// "matchType": "EXACT",
// "text": "Desk"
// }
}
}
}
]
}

Request Response:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"errors": [
{
"errorCode": {
"mutateError": "INCONSISTENT_FIELD_VALUES"
},
"message": "The field's contents don't match another field that represents the same data.",
"location": {
"fieldPathElements": [
{
"fieldName": "mutate_operations",
"index": 2
},
{
"fieldName": "campaign_criterion_operation"
},
{
"fieldName": "create"
},
{
"fieldName": "resource_name"
}
]
}
}
],
"requestId": "_bYxfOF37nzaZDeQcsNd-Q"
}
]
}
}

Thanks in advance for any insight or help

Google Ads API Forum Advisor

unread,
Jun 13, 2024, 1:30:59 AM6/13/24
to d...@charbs.com, adwor...@googlegroups.com
Hi,

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

Upon checking the provided logs, I understand that you encountered the INCONSISTENT_FIELD_VALUES error while creating the campaign criterion. which means the field's contents don't match another field that represents the same data.

Kindly note that while creating a campaign criterion, no resource name is expected for the new criterion. I would recommend you to check this document on CampaignCriterionOperation for more information.

I hope this helps. You can get back to us if you still have any issues/concerns related to the Google Ads API.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJIuj:ref" (ADR-00239942)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Reply all
Reply to author
Forward
0 new messages