Hi Amritpal,
Thanks for reaching out to the Google Ads API Forum.
I see that you have concerns regarding finding the location id for a country which contains all the cities. you may use the Campaign Criterion resource, more specifically in your question is the location. You may use the geo_target_constant report. You may see the GAQL below:
SELECT geo_target_constant.canonical_name, geo_target_constant.country_code, geo_target_constant.id, geo_target_constant.name, geo_target_constant.parent_geo_target, geo_target_constant.resource_name, geo_target_constant.status, geo_target_constant.target_type FROM geo_target_constant WHERE geo_target_constant.country_code = 'IN'
Results:
{
"geoTargetConstant": {
"status": "ENABLED",
"targetType": "Country",
"name": "India",
"countryCode": "IN",
"canonicalName": "India",
"resourceName": "geoTargetConstants/2356",
"id": "2356"
}
},
{
"geoTargetConstant": {
"status": "ENABLED",
"targetType": "Union Territory",
"name": "Andaman and Nicobar Islands",
"countryCode": "IN",
"canonicalName": "Andaman and Nicobar Islands,India",
"parentGeoTarget": "geoTargetConstants/2356",
"resourceName": "geoTargetConstants/20452",
"id": "20452"
}
},
{
"geoTargetConstant": {
"status": "ENABLED",
"targetType": "State",
"name": "Andhra Pradesh",
"countryCode": "IN",
"canonicalName": "Andhra Pradesh,India",
"parentGeoTarget": "geoTargetConstants/2356",
"resourceName": "geoTargetConstants/20453",
"id": "20453"
}
},
:
:
As you can see above, geoTargetConstants/2356 is for India which has targetType as a country. I hope this helps.
Regards,
![]() |
Google Ads API Team |