Want to see if the same search query is appearing in different ad groups?

Columnist Daniel Gilbert of Brainlabs has the perfect script to help you stay in control of your AdWords queries.

Chat with SearchBot

google-adwords-red2-1920

Having the same search query leading to different ad groups can be bad news. The data about that query isn’t all in one place, making it harder to see how it is performing. It also gets in the way of managing bids: if some queries do badly, turning the bids down in one group can mean they just pop up again in a different group that now has the higher bid, continuing to waste your money.

And it can get in the way of relevancy. You might have a beautifully specific message and landing page for [sterilized standardized scientificized owl] but end up with the specific queries going to the +owl keyword with a more generic ad.

Unfortunately, it isn’t that easy to work out when this is happening by eye, but luckily, the tech team here at Brainlabs (my employer) has built a script that finds out when the same query is appearing within different ad groups. It will save a report to a Google Sheet, showing the queries from the last 30 days and the ad groups they appear in. It also shows some metrics, like Impressions and Cost, so you can see where they perform the best.

Running this script and using its awesome power of automation allows you to just drop negative keywords into the ad groups that you don’t want the query leading to, saving you time and improving your AdWords account.

A typical output will look something like this:

queries-in-multiple-ad-groups

To use the script, first make a blank Google Sheet for the report.

Then head over to AdWords to set up a new script. After copying in the code below, you’ll need to make a few choices in the options:

  • Set spreadsheetUrl to the URL of the sheet you’ve just made.
  • If you want to ignore low-traffic queries, set impressionThreshold to a number. The script will only look at queries with more impressions than this threshold.
    • Set to 0 to look at all available queries.
  • Filter the campaigns to check with the two arrays, campaignNameContains and campaignNameDoesNotContain. For example, if campaignNameContains is ["Brand", "Generic"], then only campaigns with names containing “brand” or “generic” are included. If campaignNameDoesNotContain is ["Shopping"], then any campaigns with names containing “shopping” are ignored.
    • This is not case-sensitive.
    • Leave blank, [], to not exclude any campaigns.
    • If you need to put a double quote into campaignNameContains or campaignNameDoesNotContain, put a backslash before it.
  • If ignorePausedCampaigns is true, then the script will only look at currently active campaigns. Set this to false if you want to also check in currently paused campaigns.

The script will always use the first sheet of the spreadsheet for the report, so if you want to run it multiple times, then move the data so it isn’t overwritten.

  • If the script keeps timing out, you could run it multiple times using campaignNameContains and campaignNameDoesNotContain to look at different campaigns on each run.
  • If you have copies of campaigns for different locations, use campaignNameContains to look only at one location at a time. For example, run the script once with campaignNameContains set to [“-USA”] to look at American campaigns, and then run again with campaignNameContains set to [“-UK”] to look at the British versions.


Contributing authors are invited to create content for Search Engine Land and are chosen for their expertise and contribution to the search community. Our contributors work under the oversight of the editorial staff and contributions are checked for quality and relevance to our readers. The opinions they express are their own.


About the author

Daniel Gilbert
Contributor
Daniel Gilbert is the CEO at Brainlabs, the best paid media agency in the world (self-declared). He has started and invested in a number of big data and technology startups since leaving Google in 2010.

Get the newsletter search marketers rely on.