The contents of this website are currently being reviewed.

Scenario 1 - Optimizing Standard AdSense

This chapter provides a detailed but not at all technical step by step guide for the people operating the adverts. Start reading here if you to skip the background and get started right away.

Duration: 0 min, Technical skill required: none

Recommendations

In a default AdSense account you can change only two attribute families.


  1. Color Scheme, you can change the colors of all texts, links, border and background
  2. Corner Style, you can change the radius of the corners to make them edgy or rounded

See also The Book - Appendix B: AdSense Styling Options for details.


I recommend to create a Blueprint Experiment with separate sections per attribute family by following the Setup guide to allow easy combination.

1. Create a Blueprint Experiment

Follow the Setup guide to create a Blueprint Experiment with a descriptive name like “Blueprint Color and Corner”.

2. Create the Maximum Number of Sections

The maximum number of sections is defined by the maximum number of AdSense ad units on a single page which is usually three or less (see also the appropriate entry in the AdSense FAQ). For the following a maximum ad unit count of three is assumed.

Apply the following naming scheme to your variations: optad_[1-3]_[col|crn]

You should end up with the following 6 variations:

  • optad_1_col, color variation of the first ad unit
  • optad_1_crn, corner variation of the first ad unit
  • optad_2_col, color variation of the second ad unit
  • optad_2_crn, corner variation of the second ad unit
  • optad_3_col, color variation of the third ad unit
  • optad_3_crn, corner variation of the third ad unit

3. Create the Variations

For each color section add as many color scheme variations as you want. You can use the GWO Duration Calculator to get an idea of how many variations are suitable for you.

Each variation should look like this.

<script type="text/javascript"><!--
google_color_border = '000000';
google_color_bg     = 'DDDDDD';
google_color_link   = '000080';
google_color_url    = '008000';
google_color_text   = '000000';
//-->
</script>

You can use the Google Adsense Generator to create some color schemes.

For each corner section add up to 11 variations as you want.

Each variation should look like this.

<script type="text/javascript"><!--
google_ui_features = "rc:0";
//-->
</script>

You can choose any value from rc:0 (square corners) to rc:10 (very round corners).

Consider these recommendations when following the Setup chapter.

Duration: 30-60 min, Technical skill required: copy&paste will do

Setup

After completing this setup


  • You will have made no changes to your website.
  • You will have created 1 (stopped) experiment.

This new experiment will be used as a blueprint for all your real experiments (see Usage).


It is recommended to create one blueprint experiment for each kind of experiment you want to conduct (i.e. color variations , rounded corner variations, font variations, ..).

1. Create Missing Accounts

Make sure you enabled the following tools for your Google account.

  • Google AdSense
  • Google Analytics
  • Google Website Optimizer

2. Connect AdSense with Analytics

Make sure your AdSense and Analytics accounts are connected. If you’re not sure how to do that please follow this google support document.

If you plan to run experiments on more than one website please make sure that all of the have an Analytics pixel implemented and that their AdSense account is connected accordingly.

3. Create Base Experiment

In your Experiments tab click on Create another experiment.

step 1 - create

Choose to create a Multivariate Experiment.

step 2 - multivariate

Ignore the next page: just tick the checkbox and continue.

step 3 - complete

On the next page you need to define a descriptive name for your experiment and provide two existing but otherwise unimportant URLs.

step 4 - identify test page

Confirm that You will install and validate the JavaScript tags.

step 5 - identify conversion page

4. Validation

Google Website Optimizer requires you to validate your implementation. As for optimizing AdSense the default Website Optimizer code is not suitable you need to forge the validation process.

On the page Step 2: Install and validate JavaScript tags find the Control and Tracking Script and copy it to your clipboard.

step 6 - copy control and tracking code

Then open a new browser window and go to the Optimizing AdSense Code Generator and paste the code into the textbox.

step 7 - open code generator

You can also rename, add or remove the sections. The default values are based on the recommendations chapter of this scenario.

Now click on 1. Validation Page to download a generated webpage to pass validation. Save this document somewhere on your computer.

step 8 - download validation page

Leave that browser window open but go back to Google Website Optimizer to continue with the validation.

Choose offline validation.

step 9 - validation

Browse and select the validation page you just downloaded for both the Test Page and the Conversion Page.

step 10 - validation

Click on Continue to validate the page you downloaded.

step 11 - validation

Continue to the next step.

step 12 - validation

5. Create Variations

With the next dialog you can create variations for each section you specified.

A common color variation could look like this.

step 14 - create variations 2

Make sure that you create the same variations for each color section and also the same variations for each corner section.

You can edit, add and remove variations later as well but it is recommended to define all desired variations in the Blueprint Experiment.

6. Launch your Experiment

step 15 - launch experiment

step 16 - started experiment

7. Stop your Experiment

Next click on Stop, Continue and Save Changes to stop this experiment again.

step 17 - stopped experiment

The setup for your blueprint experiment is now completed. You can carry on with the Usage tab.

Duration: 15-30 min, Technical skill required: copy&paste will do

Usage

This chapter assumes that you have completed the Setup first as it copies an existing experiment rather than creating one.


It is assumed that you start with an existing page with working AdSense ad units!


After following this chapter you will have successfully installed an AdSense experiment on a website. You can repeat this chapter for as many pages/sites as you require.

1. Copy Blueprint Experiment

Login to your Google Website Optimizer account and choose the Blueprint Experiment that you created in Setup (also consult Recommendations about best practices).

step 1 - choose experiment

Click on Copy to create your new and already validated experiment with exactly the same settings, sections and variations.

step 2 - create a copy

2. Review your Copy

You can now review these settings and even add new or remove existing variations.

step 3 - review your copy

3. Generate Code

Go to the still open GWO Validation Generator. If you closed the window you opened in the Setup chapter in the meantime please go to step 2. Tag pages to copy the Control and Tracking Script code and paste it in the generators textbox.

step 4 - copy control and tracking code

Then provide the ID of the Google Analytics profile that is connected with your AdSense account.

step 5 - ad google analytics profile id

You can also rename, add or remove the sections. The default values are based on the recommendations chapter of this scenario. Make sure that the section names are the same as in your experiment!

Now click on 2. Generate Codes to generate the codes you will need to add to your website.

step 6 - generated codes

4. Extend AdSense Code

Copy the generated codes from the tool and paste them to your website code like the following.

4.1 Add Section Codes

Consider the following Ad Unit code.

<script type="text/javascript"><!--
google_ad_client = "ca-pub-5296440426067087";
/* test_small_square */
google_ad_slot = "3016468276";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Add the appropriate section codes in front of it. Following the Recommendations it should then look like this:

<script>utmx_section("optad_1_col")</script>
</noscript>
<script>utmx_section("optad_1_crn")</script>
</noscript>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5296440426067087";
/* test_small_square */
google_ad_slot = "3016468276";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

You can stack multiple section codes in from of an ad unit like two in the above example.

Repeat this step for each ad unit accordingly.

4.2 Add Control and Tracking Code

Paste the generated Control and Tracking Code in front of the first ad unit code!.

This is what it looked like before.

<script>utmx_section("optad_1_col")</script>
</noscript>
<script>utmx_section("optad_1_crn")</script>
</noscript>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5296440426067087";
/* test_small_square */
google_ad_slot = "3016468276";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

And this is what it should look like afterwards.

<!-- Google Website Optimizer Control Script -->
<script>
function utmx_section(){}function utmx(){}
(function(){var k='0039476117',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return escape(c.substring(i+n.
length+1,j<0?c.length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
</script>
<!-- End of Google Website Optimizer Control Script -->
<!-- Alternative Google Website Optimizer Tracking Script -->
<script type="text/javascript">
var _gaq = _gaq || [];
(function(_gaq){
  var ga  = 'UA-123456-1',
      gwo = '0039476117',
      e   = 'www.optimization-adsense.eu';
  (function(fn) {
    var d = document;
    if(d.addEventListener) d.addEventListener('DOMContentLoaded', function(){ d.removeEventListener('DOMContentLoaded', arguments.callee, false); fn(); }, false);
    else if(d.attachEvent) d.attachEvent('onreadystatechange', function(){ if(d.readyState === "complete"){ d.detachEvent('onreadystatechange', arguments.callee); fn(); }});
  })(function(){
    if (typeof(utmx) == "function" && typeof(utmx_global_vd) == "object") {
      var c = (function(s,l){while(s.length<l) s='0'+s; return s;})(utmx('combination').toString(), 4);
      var v = []; for (s in utmx_global_vd) { v.push( utmx("variation_number", s) ); }
      var v = v.join(','), n = e+' '+gwo+'#'+c+' '+location.pathname.replace(/[^\/]+$/, '');
      if(!(window._gaq instanceof Array)){
        try{ _gat._getTracker(ga)._trackSocial(n, v); } catch(err) { }
      }else{
        _gaq.push(['_trackSocial', n, v]);
      }
    }
  });
})(_gaq);
</script>
<!-- End of Google Website Optimizer Tracking Script -->
<script>utmx_section("optad_1_col")</script>
</noscript>
<script>utmx_section("optad_1_crn")</script>
</noscript>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5296440426067087";
/* test_small_square */
google_ad_slot = "3016468276";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

5. Run your Experiment

As soon as the above changes to your websites code are live click on Launch now.

step 7 - launch experiment

Your experiment is now running.

step 8 - run your experiment

You should now have a live experiment on your website!

Take a look at the following two demo pages and their source code to verify your settings.


  1. Default AdSense Integration
  2. Default AdSense and GWO Integration

Duration: 15-30 min, Technical skill required: copy&paste will do

Analyse

This chapter assumes that you have completed the Setup first as it copies an existing experiment rather than creating one.


After following this chapter you will have successfully installed an AdSense experiment on a website. You can repeat this chapter for as many pages/sites as you require.

1. Use Latest Google Analytics Interface

Make sure you use the latest Google Analytics web interface. If in the top bar next to your account name and email address you see a New Version link - click it.

2. View Experiment Data

The experiment data is stored using the so called Social Interaction Analytics feature and appear under Visitor / Social / Engagement.

step 1 - browse visitor social engagement

Set the Explorer to the AdSense view.

step 2 - adsense view

Browse to Socially Engaged and sort by AdSense CTR to get the experiment combination with the best click through rate on top.

step 3 - sort by ctr

You might need to apply a filter if other social activities are tracked as well.

3. Pick Combination

In the above screenshot you can see values for Social Source and Action that include the following information.

  • name (i.e. www.optimizing-adsense.eu), identifying this project. use this value for your filter if necessary.
  • experiment id (i.e. 0443911789), the id of your experiment.
  • combination id (i.e. #0004), representing the combination that was used for this particular case.
  • variation sequence (i.e. 1,2,0), tells you which variations were used per section where 0 represents the original (unchanged) variation.

You can now login to your Google Website Optimizer again open the appropriate experiment and pick the appropriate variations.

If the best performing variation sequence would be i.e. 1,2,0,1 you would pick the following variations.

  • optad_1_col => color variation #1
  • optad_1_crn => corner variation #2
  • optad_2_col => original
  • optad_2_crn => corner variation #1

4. Apply Best Performing Variations

You can now apply the best performing variation in one of two ways.

4.1 Change Ad Unit Style in AdSense

Login to your AdSense account and change the style of the appropriate ad unit.

step 6 - style ad unit

4.2 Write Variation before Ad Unit Code

Go to your websites code again and change this:

<script>utmx_section("adsense_color_one")</script>
</noscript>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5296440426067087";
/* test_small_square */
google_ad_slot = "3016468276";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

to this:

<script type="text/javascript">
google_color_border = "FFFFFF";
google_color_bg = "0000FF";
google_color_link = "FFFFFF";
google_color_text = "000000";
google_color_url = "008000";
</script>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5296440426067087";
/* test_small_square */
google_ad_slot = "3016468276";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

5. End Experiment

To end this experiment you have to remove the Control and Tracking Code from your website.

You should also remove the Section Codes although that is not necessary.

In Google Website Optimizer click on Stop, Continue and Save Changes to stop this experiment.

step 16 - stopped experiment

Congratulations! You just successfully optimized your AdSense revenue. :)

Step by Step Scenarios