![]() |
||||
|
||||
|
« Still working on the BBCodes II... | Beginning Python Tutorial (Part 10) » |
Fetching Unique Ads for a Contextual Advertising System
by: admin - Mar 07, 2007
A couple of days ago, I woke up with this urge to create my own "contextual advertising" thingy for my network of sites. I have some experience writing similar PHP scripts before. One I wrote using database feeds off Per Pay Click Search Engines like Miva, Searchfeed, and a few others not worth mentioning. I also wrote one specifically for GIDForums, where I had the script matching affiliate advertising for entire forum categories. For instance, I would submit a web hosting affiliate program (e.g. from Clickbank) to the MySQL database and have it displayed on all the forum pages under the Web Hosting Forums category. This one worked out rather well actually! Fast forward to 2 days ago, I decided to write something better to replace these existing scripts. This new "contextual advertising" PHP script should allow me to target down to each individual web page if I wanted it to. That is the objective. However, that's not really a problem at the moment. I have to figure out how to efficiently fetch unique advertisements off the database, for any given web page - and to make matters just a little more complicated, the advertisements would have to be sorted by bids -- just like AdSense! Some other questions I asked myself recently:
Believe it or not, asking these questions in my head repeatedly helped me figure out one possible way for me to do it. A 160x600 ad unit (the largest ad unit offered in the AdSense programme) displays up to 5 text advertisements at a time. Assuming there are 3 of these on a web page, my script would have to fetch a maximum of 15 unique advertisements per web page. Correct? I think so... The Solution... probablyMy advertising script could fetch the advertisements like this:
Simple, huh? and I think it does exactly what I want it to do. I still haven't decided what this "cache" is going to be. Is it going to be a text file or will it just be another database table? If you have any alternative ideas and suggestions, please write to me or leave a comment. I will appreciate it.
|
GIDNetwork Sites
Archives
Recent GIDBlog Posts
Recent GIDForums Posts
Contact Us
|
« Still working on the BBCodes II... | Beginning Python Tutorial (Part 10) » |