How To Rotate Ads On Your Sites

I don't know about you but I don't like to see the same ads every time I go to a web page. I like variety and to generate this variety on my sites I use a simple to use, free script to rotate same-sized ads in a particular ad slot. For example, at the top right of this site, I rotate several ads randomly on the site banner image.

The script is available for download here: www.focalmedia.net/htmlrotate.html

This is a perl script and uses javascript to save the ads, so there is no database to worry about. It is really simple to install and use and you can use the same ad blocks on any website you want to, so there is no duplication of effort on your part.

Unlike conventional banner rotators, you can add blocks of html, java, flash etc. which makes this particular script very versatile. It says it is a beta version but it works just fine, straight out-of-the-box.

The best place to install the script is to create a new sub-domain off your top level domain, call it something like ads, rotator or something memorable to you so you know what it is when you're exploring your domains.

[TIP: When you're copying perl scripts always set your ftp transfer type to ASCII otherwise it will probably generate the infamous 500 Internal Server Error problem when you try and run the script]

Once you get your script working and have access to your admin control panel you'll need to start off creating a Rotation Group (characters only in this group name). This group name is used by the script to create a filename (.js) to hold the banner codes you will be rotating. I tend to make some reference to the size of the banners here ( e.g. blogonetwofivesquare) for easy reference later.

Now you have your rotation group, you'll want to add the code snippets (banner codes) that you want to rotate. Click on the edit link along the page from the rotator name and a new page opens to let you add your code snippets. Give your snippet a unique name (characters and numerics allowed here) then paste in your code from your affiliate program, etc. I've used snippets from Commission Junction, TradeDoubler, Buy.AT with out any problem, all the click codes carry through properly.

Once you have added all the snippets you require for that particular rotator, you just click the Get HTML Code link. This will give you two very small pieces of code. The first has to be placed in the header section (somewhere before the /head code) of the website where the ads are to be rotated. In BANS stores this is usually in the Header.php of your template. The second small piece of code goes into your html or php code where you want the banners to appear.

That's all there is to it. Once you have your rotation group set up, you can include it on any website you like. If you have a niche that is covered by several affiliate programs, you can rotate all their 468x60 banners in one place, providing variety for your visitors.

Hope you find this useful.

Comments are closed.

More Articles