Getting Started With Google Adwords Scripts: CTR vs Average Position

This entry is part 2 of 2 in the series Google Adwords Scripts
7 Flares Twitter 6 Facebook 1 Google+ 0 LinkedIn 0 Reddit 0 StumbleUpon 0 7 Flares ×

In the first of our Adwords Scripts articles, we introduced every one to a basic script that checks your campaigns for any that spent money but produced no conversions and if it found any that fit that criteria, it sent you an email. Pretty basic. This one is likewise, pretty basic, but has more in common with our last Google Adwords Quality Score article – we use this script, which is a basic starter script provided by Google – to help us look for correlation between click through and ad position, while we’re honing quality scores. If you’re ready to dive in, here’s the script:

if you copy and paste, paste this into a plain text editor such as Notepad first

// Example script: analyze clickthrough rate of keywords based on their average position
// This script will not apply any changes to your account; it will only generate a report.
function main() {
// Get an iterator over keywords, ordered by best average position.
var keywordsIterator = AdWordsApp.keywords()
.orderBy(“AveragePosition ASC”)
.withCondition(“Impressions > 0”)

// Keep a running count of the clicks and impressions for each position; this data
// will allow us to calculate the average CTR.
var currentPosition = 1;
var clicks = 0;
var impressions = 0;

Logger.log(“Position vs. CTR”);
while (keywordsIterator.hasNext()) {
var keywordStats =“LAST_WEEK”);
var position = Math.round(keywordStats.getAveragePosition());

if (position > currentPosition) {
// Print out statistics for the keywords with the last average position, and start
// tracking clicks and impressions for the next average position starting from 0.
var ctr = (clicks / impressions * 100).toFixed(2) + “%”;
Logger.log(“Position ” + currentPosition + “: ” + ctr);
currentPosition = position;
clicks = impressions = 0;

clicks += keywordStats.getClicks();
impressions += keywordStats.getImpressions();

In simple terms, this script will iterate through all your active keywords, sorted by ad position, then compute the CTR. So you end up with something like this in the Log area:

Position vs. CTR
Position 1: 2.28%
Position 2: 1.65%
Position 3: 1.67%
Position 4: 3.70%

This simple table gives you a great snapshop of two key performance indicators over the previous week (you can edit this if you want to change the reporting period).

What is this metric set good for? Well, right off the bat it tells you which position your ads seem to perform better in. Of course, if you tweak this script up to iterate per ad group, you can use it to match up that positional performance to the type of keyword used, which helps you separate top-of-funnel keywords from bottom-of-funnel keywords. Once you know this, you can confidently match your top of funnel keywords to ads that have better sidebar CTR and bid down to save some money. If you iterate per ad, you can dissect your text ad wording and confidently position “champion” ads in the positions where the CTR is highest.

If you are also running Quality Score reports for the same period, you could potentially graph CTR versus Quality Score changes to find QS correlations with improvements in CTR. Here’s a real life example: as Google Partners, we often participate in Adwords Beta programs. While testing an adwords feature that would only function when the ads were shown in position 1, we discovered that our CTR and Quality Score dropped, even though our ads dominated top positions and looked really cool thanks to the feature we were testing. In the end, we paid more per click not just because we bid up to position 1, but also because we lost at least a point across the board on Quality Score for the campaign. This QS change seemed to correlate to an overall CTR drop from 3% to just over 2%. Even though our ads were in the number one spot, they didn’t get clicked on as often because of the types of keywords we targetted and ads we were using.

Had we run this CTR vs Avg Position report first, we’d have seen that the best CTR occurred in position 4 and realized that pushing all our keywords to position 1 might not be a good move, even for the sake of a beta test.

So there, you are – a really simple script that writes its details straight into the Log Details for you. Who knows, maybe I’ll find (or write?) a combo script that will combine this comparison with the Quality Score report and write them all into a Google Docs spreadsheet so they can be graphed together! Or not. We’ll see how much spare time I have.   :)

Series Navigation<< Getting Started With Google Adwords Scripts: Alert for Campaigns with No Conversions
The following two tabs change content below.
Michelle has worked on the Internet (sometimes, literally) since before it had pictures, learned web development in HTML before it was iterated, worked in SEO when there were 12 search engines, watched Digg become the grandfather of social media, worked as a Google page rater, and predicted today's holistic online marketing environment back when MySpace was a thing. And she makes kick-ass fajitas.

Latest posts by Michelle Moore Scott (see all)

Leave a Reply

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