AdWords Script to Set Radius Targeting in Bulk

AdWords Editor does actually support proximity targets where you set the radius targeting of your campaigns via uploading the longitude and altitude in a specific format. However, a common issue that you might face when adding your location targets in bulk is “Unresolved Location” where editor doesn’t recognize the areas’ addresses. This might result in failing the completion of importing all location targets.

On the other side, AdWords scripts are more powerful in creating proximity targeting where most target points go through without any errors as long as all info is accurate. Moreover, you can automate the process of updating your radius targeting through scheduling the script to run on a frequent basis based on your needs.

Accordingly, we’ve written a simple AdWords script that connects to Google sheets where you provide campaigns names and the necessary location arguments ( Latitude, Longitude, Radius, Radius Unit).


radius targeting location script


#Latitude: The latitude of the central point.
#Longitude: The longitude of the central point.
#Radius: The radius of the proximity target.
#Radius Units: The units of the radius, either “MILES” or “KILOMETERS”.

After you create and fill your sheet with all the details, it’s time now to add the spreadsheet URL in the script source and run it.

* Radius Targeting Script
* Version 1.0
* Created By: Ahmed Ali
function main() {
  var SPREADSHEET_URL = "INsert your spreadsheet URL here";
  var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
  var sheet = spreadsheet.getActiveSheet();
  var data = sheet.getRange("A:E").getValues();
  for (i in data) {
  if (i == 0) {
  continue;  }

 var [CampaignName, latitude, longitude, raduis, unit] = data[i];

 if (CampaignName == "") {
  else {

  var campaignIterator = AdWordsApp.campaigns()
  .withCondition("CampaignName CONTAINS_IGNORE_CASE '" + CampaignName +"'")
  while (campaignIterator.hasNext()) {
  var campaign =;
 campaign.addProximity(latitude, longitude, raduis, unit);


  1. This is awesome. One note, I tried running the script using the link from the 7th or 8th tab in a Google doc and the script ran, but didn’t make any changes. I made a brand Google doc and put everything on the first sheet and it worked perfectly!

  2. Matt

    This is saving me TONS of time! Thank you so much for developing this script. I can’t believe it’s not native to Google Ads interface – especially after they updated it recently.

  3. Aashish

    Hello Ahmed,

    I want to change the heading 2 based on radius location? Is there any script related to this?
    eg: If someone is near by restaurant within 2 km, then he will get heading 2 as “reach us within 2 mins”.

Leave a Reply

Your email address will not be published. Required fields are marked *