Advanced Google Ads script removes locations from keywords

This script automates the removal of individual locations from keywords at-scale within Google Sheets.

Chat with SearchBot

One of the most tedious tasks when working with location-based keywords is removing the individual locations from the keywords at-scale. These are the location-based keyword terms such as “car dealership London.”

Like with any tedious, repetitive task the developers at my agency created a Google Ads script to automate removing the locations from keywords within Google Sheets.

How the script works

The script pulls all of the keywords within your account and then searches each one against our database of all UK locations. 

You can also configure it to only pull keywords from certain campaigns in the settings which I will explain in the setup section below.

It then pulls the location from the keywords and creates an output as below. The keyword is in the first column and then the location that is contained within it is in the second column.

RuNVgtg3eG7SGEeJ1QZWsEXpUTbLQn8ju RkkOpKwh9o9O ZUW10bfJOIVtPC531g5yGWBacpvIivW5n91LQdfZdaLyjNecpCmDzyGfPivNCvR0HcNa Np4RMJwQAexTs6KBrl8Q

How to set up the script

Before you can run the script there are a few variables that you need to configure.

  • On line 18. You will need to create a new Google Sheet which will be used to output the report showing the keywords and the locations within them. You will then need to specify the URL of the sheet that you want the report to be outputted to on line 18 of the script. 
  • On line 21. You can change which campaigns you want to include. To include all of the campaigns that contain the term “brand” for example, you would enter the word “brand” here. if you want to include all of the campaigns, then just leave this field blank.
  • On line 22. On the other hand, if you want to exclude all of the campaigns that contain the term “generics” for example, you would enter the word “generics” here. if you want to include all of the campaigns, then just leave this field blank.

The script 


Opinions expressed in this article are those of the guest author and not necessarily Search Engine Land. Staff authors are listed here.


About the author

Wesley Parker
Contributor
Wesley is managing director at Clicteq. He currently manages a $4M-plus Google Ads portfolio across a range of different sectors. He regularly writes in leading marketing publications such as Econsultancy and Campaign Magazine.

Get the must-read newsletter for search marketers.