Geo target constants error

44 views
Skip to first unread message

Maxime Heurtevent

unread,
Apr 26, 2024, 8:51:19 PMApr 26
to Google Ads API and AdWords API Forum
Hello,

I'm trying to call the https://googleads.googleapis.com/v16/customers/{customerId}:generateKeywordIdeas endpoints with the parameters below.

The geoTargetConstants have been generated with the https://googleads.googleapis.com/v16/geoTargetConstants:suggest endpoint and were successful (According to the excel sheet containing all the locations, all the constants are related to one)

This params generate an error:
{
  "geoTargetConstants": [
    "geoTargetConstants/2312",
    "geoTargetConstants/9070394",
    "geoTargetConstants/9069935",
    "geoTargetConstants/1007479",
    "geoTargetConstants/1007477",
    "geoTargetConstants/1007476",
    "geoTargetConstants/1007478",
    "geoTargetConstants/2175",
    "geoTargetConstants/9075994",
    "geoTargetConstants/9075993",
    "geoTargetConstants/9075991",
    "geoTargetConstants/9075992",
    "geoTargetConstants/9075990"
  ],
  "includeAdultKeywords": true,
  "pageSize": 25,
  "keywordPlanNetwork": "GOOGLE_SEARCH",
  "language": "languageConstants/1002",
  "siteSeed": {
    "site": "https://www.skyteam.com/en/"
  }
}


Here is the error:
{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure",
        "errors": [
          {
            "errorCode": {
              "keywordPlanIdeaError": "INVALID_VALUE"
            },
            "message": "The input has an invalid value.",
            "location": {
              "fieldPathElements": [
                {
                  "fieldName": "geo_target_constants"
                }
              ]
            }
          }
        ],
        "requestId": "L4Iz-V3njTr0Nm0d6L74CQ"
      }
    ]
  }
}

Nevertheless if I remove
"geoTargetConstants/9075991",
"geoTargetConstants/9075992",
"geoTargetConstants/9075990"

the API call to generate keywords succeed, but if i keep these constants and then remove those 3
"geoTargetConstants/1007477",
"geoTargetConstants/1007476",
"geoTargetConstants/1007478",

the error also doesn't occur anymore.


Google Ads API Forum Advisor

unread,
Apr 29, 2024, 7:57:20 AMApr 29
to m.77.heurtev...@gmail.com, adwor...@googlegroups.com
Hi,

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

After verifying the provided logs, I could see that you are encountering the INVALID_VALUE error. Kindly note that "The input has an invalid value" means that the request body that you passed as an argument to the KeywordPlanIdeaService is not a valid argument. The allowed geo_target_constants[] is a maximum of 10, whereas you have passed the 13 geo_target_constants.

Also, I have tried to replicate the issue from my end and I am able to generateKeywordIdeas with the 10 geoTargetConstants. So, kindly retry the request by modifying the geo_target_constants[] values to 10. Let us know how this goes on your end.​ ​ ​ ​ ​ ​ ​
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tPKda:ref" (ADR-00232871)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages