AdSense experts have always told beginners to experiment with AdSense ads – to determine which format will perform best for their website or blog. Beginners commonly experience a very low CTR on their sites with moderate traffic. CTR, expanded as Click-through rate, is the number of clicks on ads on a website divided by the number of ad-impressions, expressed in percentage. You can perform A/B testing with Google AdSense ads to figure out the most effective ad-format with highest CTR for you.

Lets take a deeper look into A/B Testing with AdSense ads:

increase adsense ctr clicks

Say, you want to test two different formats (which differ in appearance and/or dimensions) and you are not sure which will interact better with the visitors on your website, hence gaining the CTR; you should test those two AdSense ad units using A/B Testing for a certain period of time, track their performance and finalize the best ad format for that position on your website. The idea of A/B Testing is to randomize ads on every page load, this will help us to record the performance of both ads.

How to perform A/B Testing with AdSense ads to increase CTR?

We take an example of a commonly practiced AdSense ad-placement: 336×280 ad below the post Headline. Now, you want to experiment that unit for two different colors, say blue and red, to get the best performing arrangement out of it.

  • Create a 336×280 ad unit with blue-colored links (suppose this is Ad ‘A’), and assign a custom channel, say ‘blue’ to it (custom channels will help us to track the results later).
  • Similarly, create another 336×280 ad unit with red-colored links (say this Ad ‘B’), assign a custom channel, say ‘red’ to it.
  • Use your ad in any one of the two scripts depending on your choice:

    JavaScript:

    I covered the JavaScript method previously in: How to display random ads on your website?

    <script type="text/javascript">
      var random_number = Math.random();
      if (random_number < .5){
        // Ad 'A' code goes here
      } else {
        // Ad 'B' code goes here
      }
    </script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

    PHP:

    <?php
      $random_number = rand(0, 1); ?>
    <script type="text/javascript">
    <?php
      if($random_number < .5){ ?>
         Ad 'A' code goes here
      <?php } else { ?>
         Ad 'A' code goes here
      <?php } ?>
    </script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

    Place the code below post headline or wherever you want.

Correct Usage

Since modifying AdSense ads is a bit tricky process, you should use below samples to do the modifications for A/B Testing implementation. [You will need the only part after script tags (from <!– to //–>) after generating code from AdSense].

JavaScript:

<script type="text/javascript">
  var random_number = Math.random();
  if (random_number < .5){
    <!--
    google_ad_client = "pub-xxxxxxxxxxx";
    google_ad_slot = "xxxxx";
    google_ad_width = 336;
    google_ad_height = 280;
    //-->
  } else {
    <!--
    google_ad_client = "pub-yyyyyyyyyyyy";
    google_ad_slot = "yyyyyy";
    google_ad_width = 336;
    google_ad_height = 280;
    //-->
  }
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

PHP:

<?php
  $random_number = rand(0, 1); ?>
<script type="text/javascript">
<?php
  if($random_number < .5){ ?>
    <!--
    google_ad_client = "pub-xxxxxxxxxxx";
    google_ad_slot = "xxxxx";
    google_ad_width = 336;
    google_ad_height = 280;
    //-->
  <?php } else { ?>
    <!--
    google_ad_client = "pub-yyyyyyyyyyyy";
    google_ad_slot = "yyyyyy";
    google_ad_width = 336;
    google_ad_height = 280;
    //-->
  <?php } ?>
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

People often don’t use the JavaScript method, as modifying the AdSense ad code is against Google TOS, but it is actually suggested by Adsense team itself [read more on AdSense Official blog], so you can use the JavaScript method without worries any more. People who consider loading a single ad slot at one time processed at server side, should go with the PHP snippet.

Track the results

After a certain period of time, say after 2-3 weeks (or after a full month), compare the custom channel reports in Adsense and analyze which one has the better CTR. You can finalize the related high-performing format or start a new experiment again, to get a more better results!

Also see how to improve AdSense CTR by making ads relevant.