How to Perform A/B Testing on Adsense Ads?

Google Adsense is the most popular and one of the best monetization methods to earn money online through blogs. The earnings from the Adsense ads depend on several factors which include – type of blog niche, ad placement, ad color and even the size of the Adsense ad that is displayed on your blog.

But, how will you know which Adsense ad works well with your blog design & niche? This is where the A/B testing comes to the scene.

Adsense A/B Testing is the best method to find out which Adsense Ad unit/format is giving you the best results i.e., which ad unit is getting the highest CTR and CPC. Placing the right ad format at the right place will help you to earn more. There are many best Adsense placements suggested by popular bloggers, but in reality it differs from site to site. The ad formats placed on my site may not suit your blog niche or design. The only way to find it out is by performing A/B testing on your Adsense ads .

How to Perform A/B Testing on Google Adsense Ads?

Let’s take for example, I displayed an ad at the top menu (728 x 90) which is a text+image ad. But, I wanted to test the 468 x 60 ad unit in its place just to determine which ad format is performing well for me.

PS: You’ll need to create two different ad units to test out. In my case, I created 728 x 90 and 468 x 60 ads using the Adsense Dashboard and also gave the channels an appropriate name as it helps while comparing the results.

Perform A/B Split Testing on Adsense Ads

As per Adsense ToS, you’re not supposed to edit or modify the existing ad code, but Google has given a consideration just for the A/B testing and that too without editing the code.

Tip: Make your Adsense Ads Responsive w/o violating the ToS

All you need to do is to place your two ads’ code in the below JS script

<script type=”text/javascript”>
var random_number = Math.random();
if (random_number < .5){
// first ad unit code
} else {
// second ad unit code
<script type=”text/javascript” src=””></script>

Just replace the above two lines in red with your ad code (first ad unit and second ad unit respectively) and place the entire javascript code where you originally placed your ads (the placement which you wanted to test).

The correct usage of the Adsense A/B testing code is as follows.

<script type=”text/javascript”>
var random_number = Math.random();
if (random_number < .5){
google_ad_client = “pub-XXXXXXXXXXXXX”;
google_ad_slot = “12345”;
google_ad_width = 728;
google_ad_height = 90;
} else {
google_ad_client = “pub-XXXXXXXXXXXXX”;
google_ad_slot = “56789”;
google_ad_width = 468;
google_ad_height = 60;
<script type=”text/javascript” src=””></script>

The concept behind this ad code is, it displays random ad unit for every few page impressions and so the two ad units will get some clicks which help you to determine which Adsense ad unit out of these two is getting the high CTR or CPC.

After a due course of time (my suggestion would be a week or two), just go to your Adsense Reports, click on “Ad Units” and check which ad unit is performing well. You can also make use of the Abtester tool to judge your results. And then replace the existing javascript code with higher earning ad unit code (regular/actual JS code provided by Adsense).

Note: You can perform a variety of testings other than just an Ad unit test. For example, you can test the same ad units with different color formats to determine which color ads are performing well. In my tests, I’ve found that the text-only ad below the post title works fine. Both the 728×90 and 468×60 have given me the similar results.

Adsense A/B Testing : Possible Test Cases

  • Testing Ad formats – Textonly, Image Only and Text+Image
  • Testing Ad sizes – 768×90, 468×60, 336×280, 300×250 and 160×600 (these were the best performing ad units. I didn’t find the newly introduced ad units like 300×600 and 970×90 giving good results)
  • Test Ad colors – Same color as your blog design, contrast colors, with and without borders etc…
  • Ad Placement Testing – Beside Logo, Top-Right Sidebar, Under the Post tile, End of the Article, Middle-Right of the sidebar and so on based on your blog layout.

That’s it! There is no guarantee that the techniques that work for me works for you too. It depends on several factors and the only way to find it is through testing it personally. So, start testing right ahead and improve your Adsense earnings.

Last Updated on by Radha Krishna under Make Money Online Category 2 Comments

Tags: ,


Share This Article

Get Free Email Alerts

Stay Updated with Useful Blogging Tips. Get Free Email Newsletter Updates..

And, Next Confirm Your Email Subcription


2 Comments to “How to Perform A/B Testing on Adsense Ads?”

  1. No Comment yet. Be the first to comment...
Leave your comment here:

CommentLuv badge

Unable to load the Are You a Human PlayThru™. Please contact the site owner to report the problem.

We Use & Recommend
[Bluehost - Review | Installation | Discount ] Bluehost Coupon
Free Email Alerts
Facebook Twitter Google Plus RSS Feed Email
Rate Us

Like US