Discussion Locked

Ad Rotation Perl Script help please?

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello

I am trying to do ad rotation on my website and my site pages are generated from a CGI script and I need to figure out the best way to perform what i want to do.

I really want to display Text Ads only that have a dynamic URL under them and I want to have 5 or 6 in the rotation so that every time the page is refreshed a different one of those get more exposure.

SSI is parsed when you do a CGI generated webpage therefor I can't use SSI. ( unless ofcourse seomeone knows how we can )

Well

If there is anyone out there that has knowledge that they are willing to share as far as CGI and Ad rotation, Please write me back and let me know. That's when I can get into some more details for you ok

Thanks
Rick MacLeod

1 reply

by geoffreyc

There is no guarantee one user will refresh a page, so you may end up having to settle with a different ad for different users, unless you go for a javascript solution, in which you would have to use images of the text in order to get them to change(with SetTimeouts to tell the browser when to change images), or Java which has the InnerHtml property that allows you to change text on the client side.

To do it in perl, set it up so that you check the time each time the page is loaded. Take only the seconds part, and divide it by say 6 if you have 6 ads. If it's less than 10, write the url and ad for number one, if it's between 10 and 20, write number two ad and url.

I don't know how the professional advertising rotators might do this, but this solution would be a simple way of choosing between alternate ads for each time the page is displayed.

Hope it helps,

Geoff

This discussion is closed to new replies.