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:
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:
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
You can use any webserver you already have, it just need to serve the files in the pagead folder, with no additional capabilities.
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.
Below you can see a real Medium Rectangle vs a faux one in a split test.
Real Ads:
Faux ads:
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.