Keyword Labelling Script

This script lets you label keywords based on organic rank data, which means you can see how SEO is affecting PPC.

What’s included?

How does the script work?

You fill out a Google Sheet with the organic positions of your site and a few competitors, and this script will label up any matching keywords in your account with those positions. This makes it easy to analyse how SEO is affecting your PPC performance!

How do I use it?

  1. First set up a new Google Docs spreadsheet, and set up Sheet1 like this:
  2. The first row is the headers – fill in your name and your competitors’ names.
  3. Then the first column is the keyword text, followed by the organic positions of the sites.
  4. If given this sheet, the script will label the keyword ‘search query’ with ‘Us – 3’, ‘Competitor 1 – 1’ and ‘Competitor 2 – 6’.
  5. If a position is blank or over 9, the script will assume that means the site was not on the first page of results: the keyword ‘keyword’ would be labelled with ‘Us – Off First Page’, ‘Competitor 1 – 6’ and ‘Competitor 2 – Off First Page’
    If you want to do a before/after analysis, you could put in your current ranks and previous ranks, like this:
  6. Then go to your Google Ads account and copy and paste in the script below. There are a few settings to change:
    • spreadsheetUrl is the URL of your spreadsheet.
    • Use campaignNameContains and campaignNameDoesNotContain if you only want to label keywords in some campaigns.
    • Set includePaused to true if you want to label paused keywords, in paused ad groups and campaigns.

The Keyword Labelling Script code