Time-Saving Way To Update AdSense Ads

Posted April 27th, 2006. Filed under Contextual Advertising

Imagine this: You run a website with hundred of pages, and on each page you have AdSense code. What if you want to change the color of your AdSense ads, do you edit all of those pages manually? What if you have not only hundreds, but thousands of pages?

If you’re still updating them manually, you should stop now. It’s a waste of time! Here’s what I do. I automate the insertion of AdSense code into my web pages using SSI (server side included). In order to use SSI, you’ll need to ask your web hosting company whether their server supports SSI or not. Nowadays, most web hosting companies allow you to use SSI. If their server doesn’t support SSI, it’s time for a change. If you want to switch to another web hosting company like 3rdSphere which we are using now.

Here’s how to do it. You just put the AdSense code in a text file, save it as ‘adsense.txt’, and upload it to the root directory of your web server. Next, call the file on all your pages using a simple SSI call like this:

#include virtual=”/adsense.txt”

Whenever you want to change to color of your ads, or the layout, simply edit the text file, upload it to your website, and voila, the change can be seen on all pages. This trick is really a time saver especially for those who use automatic page generators to generate pages on their website.


Google Analytics integration offered by Wordpress Google Analytics Plugin