Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to count banner impressions and Clicks
    text
    copied!<p>We have a small php script, that displays random adverts on our site . The banners are served from any location we designate.</p> <p>What I really would like to know, or be pointed in the right direction is, can we somehow collate the number of impressions each banner gets and possibly the click count on that banner.</p> <p>I am sure this can be done in php, and stored in a db. Just havent got a clue. I searched on Google, and seemingly everything I could find harks back to 2002 and 2003 lol.</p> <p>Here is our script:</p> <pre><code>&lt;?php $Img1 = "path to image folder/banner.png"; $Alt1 = "alt text for banner"; $Url1 = "http://www.externaldomain.com"; $Img2 ="path to image folder/banner.png"; $Alt2 = "alt text for banner"; $Url2 = "http://www.externaldomain.com"; $Img3 ="path to image folder/banner.png"; $Alt3 = "alt text for banner"; $Url3 = "http://www.externaldomain.com"; $Img4 ="path to image folder/banner.png"; $Alt4 = "alt text for banner"; $Url4 = "http://www.externaldomain.com"; $Img5 ="path to image folder/banner.png"; $Alt5 = "alt text for banner"; $Url5 = "http://www.externaldomain.com"; $num = rand (1,5); $Image = ${'Img'.$num}; $Alt = ${'Alt' .$num}; $URL = ${'Url'.$num}; Print "&lt;a href=\"".$URL."\"&gt;&lt;img src=\"".$Image."\" alt=\"".$Alt."\" /&lt;/a&gt;"; ?&gt; </code></pre> <p>To initiate the above code ( we fire an include request )</p> <pre><code>&lt;?php include ("../adserver/thescriptabove.php"); ?&gt; </code></pre> <p>Any help appreciated</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload