Adsense test ads - Lorem ipsum ads Home

UPDATE: Now you can have REAL ADS not associated with your Adsense publisher ID using a proxy to Blogger ad generator. Check it out here

I suppose this is a problem every Adsense beginner faces: how can I test my site's live layout without risking to violate Adsense Terms of Service (TOS) and getting my adsense account cancelled?

It's impossible to never see the ads on your website. You need to test it. And when you're testing new layouts and templates, the page impressions may easily soar. Imagine a large account with dozens of different, unrelated websites. I would want to ensure the layout is optimal, and you have to test in different browsers, devices and operating systems. Impressions would increase tenfold, at least.

You can block the ads, but you won't be able to do an effective advertising placement test. The real ad is very important. In the past, people used an unofficial, not to say unwise, modification of the adsense ad code to "flag" a test mode with "google_adtest=on;". It doesn't make much sense anymore since the new adsense code only references your ad unit ID and a beginner is certainly using the standard code.

Even if such modification still works with legacy code, the main problem still remains: how to see the live, finalized website just like the visitors see them. I tried some unsatisfactory methods:

  • Image placeholders: the Adsense site offers plenty of images of ads you could use as placeholders. But you would have to alternate between "test mode" and "real mode". Not what I wanted, cumbersome and error-prone.
  • Ad blocking: this avoids the problem of selectively changing the template and allows for viewing the finalized site, but as I said earlier, the layout with ads blocked is much different from otherwise. Even if you correctly size the blank areas so they don't get deformed when lacking ads, their text, image and multimedia components do count in layout. Without live testing, you'll never know which color or font size is perfect or ugly, if images and videos are appropriate, etc.
  • Online solutions: these initially look good, but you give them up after the novelty passes. Tools like Adsense Sandbox or Browser Shots, despite their usefulness, don't give you the flexibility that in loco access provides.

So, what was my solution? I can't have the real ads displayed, but I need them. So I decided to imitate them. Take a look at the default adsense ad code:

			<script type="text/javascript"><!--
			google_ad_client = "ca-pub-xxxxxxxxxxxxxxxx";
			/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
			google_ad_slot = "xxxxxxxxxx";
			google_ad_width = 728;
			google_ad_height = 90;
			//-->
			</script>
			<script type="text/javascript"
			src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
			</script>

Adsense sites inform the ad dimensions and id and load the adsense script which contextually renders the targeted ads. My solution is to change where my design/development computer gets such script from, so it will show my placeholders, which are the closest possible to the real ads, including image/text alternation and color customization. Those sample images Google provides are just prehistoric and don't help you if you're going to blend the ads. It works in three steps:

  1. Change your hosts file to make googlesyndication.com and pagead2.googlesyndication.com point to the desired webserver in your network. I change Google Analytics also since I like real figures in the reports:
    127.0.0.1 pagead2.googlesyndication.com
    127.0.0.1 googlesyndication.com
    127.0.0.1 google-analytics.com
    127.0.0.1 www.google-analytics.com
  2. Create the virtual folder pagead pointing to the folder of same name contained in the download package.
  3. Reset the network connections of all computers and devices which will test the new faux ads. While the webserver is up and running, you'll see lorem ipsum ads. When it is shut down, it will work as an ad blocker. In the case you want to see the real ads again, comment those lines on the hosts files.

You can use any webserver you already have, it just need to serve the files in the pagead folder, with no additional capabilities.

The one click method

There's this excelent ready-to-go webserver called mongoose which serves everything in the folder it is located. I've included it in the download package, so if you don't have a webserver you can just click on loremipsumads.exe and it will do the work. Note that it will change your hosts files and start a webserver listening on port 80, so you need to run it as an administrator in the first time and concede permission on your firewall and other security software. Source code is available if you want to see what it exactly does.

See it in action

Below you can see a real Medium Rectangle vs a faux one in a split test.

Real Ads:

    

Faux ads:

    

Final notes

Now you can do any layout/templating testing you need without concern about the number of ad impressions or accidental clicks, and, above all, without the hassle of switching ads on and off. The download links are in the footer of the page.

The script rotates the ad type every 5 seconds in four cycles: text only, images only and two cycles of video only. The first video cycle falls all non-video ads back to text. The second one allows for images. With this cycle approach I check my site and see how different blends work together.

Note: bear in mind that this is just a copy of the real ads with random lorem ipsum and the possibility of color and font customization, and still a work-in-progress. They are by no means exact copies, so you'll notice some discrepancies, but it's great to test.


DOWNLOAD Lorem Ipsum Ads script (v0.01)