Hi Rotating banners can be seen everywhere, on all web sites. I am just wondering if some body could explain the best practices to implement rotating banners on a web site. I know about the JavaScript that rotates banners after specified amount of time or on each page refresh. This process can be randomized as well. But if we were to keep track of banner impressions and click rates etc? What will be the best way to do it? Thank you for any help in advance. Cheers
You should use php to track clicks and impresions. Make a php file like banners.php and make some vars to know what image to display. For example <img src="banners.php?banner=123" /> You just have to change the headers of php file to jpeg and into the db to have the image link for each id.For example for banner=123 (so the id is 123) link will be image123.jpg Use mysql to track clicks and impresions : In php will get the current value of impresions and clicks from db and add 1 to impresions when a banner is loaded and 1 to clicks when the banner is clicked Example: //here to get the current value of impresions from db .................. //here increase to impresions(every time the page is loaded) $impresions++; //now update the impresions number into the db .................. //here if the banner is clicked (the link for the banner will be like banner.php?banner=123&click=1) //here will be the code to get clicks .......... $clicked = $_GET['click']; if ($clicked =1 ){ //now increase the clicks number clicks++; //now update the number of clicks into the database ............ } Code (markup): The code to be added into the page where to display the banners : <a href="http://example.com/banners.php?banner=123&ckick=1" title="Banner"> <img src="http://example.com/banners.php?banner=123" alt="Banner" /> </a> HTML: Is just one idea..there are a lot of ways to do that.