Hi guys I am working on building a custom adertising script for my site, my site is pretty high traffic so performance is always number 1 priority

Advertisements
- Can be html/flash/text anything
- Have to update impressions and stats on every load
- Will randomly show between all ads in the DB that are active
- I can even ad my adrite ads or google adsense code into an ad campaign.
- expire banners after x amount of time
- add weight to banners to show more often
- enable and disable banner option.

Admin
- Add/edit/remove ads
- Can see impressions/click stats for any ads

User - person paying for advertising on my site
- Will get to see a page with an ID number used as $_GET to view stats on there ads, including start date, end date, clicks, impressions

Question 1)
I question here is what is the best way to update impression count when an ad is shown, it would seem that selecting random ad from DB and then Updating impression count on every page load is not the best performance, is there better ways to do it?

Question 2)
I know how to show a random ad, but if ads have a weight system of 1-10 or 1-5 how can I go about making higher numbers show more often?

Question 3) For keeping track of clicks and impressions per day what is the best way to do this, maybe make a new row in DB every single day for every single ad in DB and then update that row everyday?

    Did you check this (PhpAds)? is free and pretty good at this ...

      yeah all the premade scripts are just not as lightweight as I would like

        Write a Reply...