Google Ads: GeoTargetConstant service - ability to search worldwide

105 views
Skip to first unread message

integrations bidalgo

unread,
Jun 27, 2019, 5:01:33 AM6/27/19
to AdWords API and Google Ads API Forum
Hello,

In AdWords API we had ability to search geo locations worldwide (without specifying country code).
In GoogleAds country code is required parameter:

$response = $this->geoTargetConstantServiceClient->suggestGeoTargetConstants(
new StringValue(['value' => 'en']),
new StringValue(['value' => 'US']),
['locationNames' => new LocationNames(['names' => [$names]])]
);

Is there still an opportunity to search worldwide in GoogleAds?

Google Ads API Forum Advisor Prod

unread,
Jun 27, 2019, 3:44:00 PM6/27/19
to integr...@bidalgo.ai, adwor...@googlegroups.com

Hi,

Thank you for reaching support. With regards to your concern, the equivalent for getting the geo_location worldwide in Google Ads API is to use geo_target_constant resource. You could search the geo_locations without specifying the country code which will give you location name in all regions worldwide. Let us know if you need additional information.

Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UCZmou:ref

Afsane Ghafoori

unread,
Nov 4, 2019, 9:00:57 PM11/4/19
to AdWords API and Google Ads API Forum
Hello there,

I have the same problem. I tried to call the "suggestGeoTargetConstants" method without passing the country code but it didn't work. Did you find the solution?

Afsane Ghafoori

unread,
Nov 4, 2019, 9:24:56 PM11/4/19
to AdWords API and Google Ads API Forum
Hello there,

I have the same problem. I tried to call the "suggestGeoTargetConstants" method without passing the country code but it didn't work. this is the request I passed to the method:

const suggestGeoTargetConstantsRequest = {
            geo_targets: ["geoTargetConstants/9060871"]
        };

and I got this error: "3 INVALID_ARGUMENT: The country code is invalid.

even when I set the request with the country_code like the image below, the return result data is empty!
could you help me, how should I set the request to receive suggestion around the world?


    const suggestGeoTargetConstantsRequest = {
            locale: "au",
            countryCode: "AU",
            geo_targets: [
                "geoTargetConstants/9056922"
            ]
        }

Google Ads API Forum Advisor Prod

unread,
Nov 5, 2019, 11:19:27 AM11/5/19
to ghafoor...@gmail.com, adwor...@googlegroups.com

Hi Afsane,

Thank you for reaching out regarding your concern. Could you please try to get the geo target constant locations without passing country code using the code sample provided here? If you are still facing error, could you please share the complete request and response logs along with the client customer id for me to investigate this further on my end? Please use Reply privately to author option while sharing the details.



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UCZmou:ref
Reply all
Reply to author
Forward
0 new messages