APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Using Google Channels to test layouts

© November 2006 Anthony Lawrence


Update: Google now has integrated Adsense into Analytics - this is great news!

If you use Google Adssense on your website, you probably are interested in maximizing your revenue. But how to do that? Where should you place your ads? What sizes should you use? Google offers some general ideas, but tells you that you need to test and tweak, tweak and test.

Well, that's true, but until recently, the testing part was a bit difficult. For example, you make a change on Wednesday and compare it to Tuesday's earnings. Ooops, different days of the week are often quite different in earnings even when you leave everything alone. Holidays and events in the real world can affect earnings also, and sometimes earnings are up or down for no reason at all: it just happened. So how can you tell if a change is doing you any good or not? It's frustrating, because until recently, the only way you could tell was to run your tests over long periods of time, and of course that can change things too: what if your site becomes more or less popular during your testing?

Well, in the old days, we tried to do this by running tests on similar pages. That is, we'd try to find two pages on our site with similar content, similar popularity, and similar Adsense earnings. We'd change one, and compare the results. That's useful, but the pages are only similar, so other factors can still skew our results. Arrgh.. there has to be a better way!

There was. You could install software like Asrep, which gives you very detailed tracking. However, that mostly gives you a page level view of your earnings: this page earned X from ad type Y and so on. That's good, but it still isn't quite enough.

One thing that may not be immediately obvious is that everything is related. Every single thing you put on a page affects Adsense earnings; good, bad or indifferent. Even ads affect each other: having multiple ads can increase your earnings, but it can also decrease them. How do you track this stuff?

Google has now added multiple ad channel tracking. This lets you tag your ads with up to five separate channel tags: "google_ad_channel = "8338221560+2579359968+9929927590+5782134881+5000158698";' for example.

We can use up to four of those tags to track whatever we want. I track article age, location, author, and ad size. That leaves the fifth channel free for testing. Of course all of this is generated by code, but for testing, the ability to control your pages by code is particularly important. For example, let's say I want to test whether running Google's Link Unit ad ad the top of the page helps or hurts other ad earning. I have two ad channels devoted to this purpose: "Current Test" and "Not Current Test". The code looks something like this:

$gadch5="+3251005891" ;
# Not Current Test
sub linkunit {
if (int(rand(2))) {
$gadch5="+5109434935" ;
# Current Test
print <<EOF;
google_ad_channel ="$gadch1$gadch2$gadch3$gadch4$gadch5";

That runs the link units approximately 50% of the time, and tags the Google ad channel appropriately. Note that EVERY ad on the page will end up with $gadch5 set one way or another, so at the end of the day, Current Test and Not Current Test should have approximately the same number of impressions, but will have different earnings. I'm also tracking each ad size, so if the difference in those is attributable to the earnings of the link unit ads that did run, then turning this on or off has no bearing on the earnings of the other ads. However, that's probably not the case: this WILL affect other ads.

Which did it specifically affect? Well, to find that out you'd need two possible channels for each ad size: for example "336x280 with Current Test" and "336x280 without Current Test" and you'd set those based on whether or not the Link Unit was running. Continue down this path, and you might find that some sections of your site do better with link units and some don't.

Without tracking and testing, you are working in the dark. Google has provided us the ability to zero in on performance details; all you need to do is implement it.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> Using Google Channels to test layouts

Inexpensive and informative Apple related e-books:

Take control of Apple TV, Second Edition

Take Control of Preview

Take Control of Parallels Desktop 12

Photos: A Take Control Crash Course

Digital Sharing Crash Course

More Articles by © Anthony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

Principles have no real force except when one is well-fed. (Mark Twain)

Linux posts

Troubleshooting posts

This post tagged:



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode