Hi, Im trying to set up a little tracking system to store the username, IP and page when a google advert is clicked.
Javascript to call when a user clicks on an advert:
<script type="text/javascript">
function logClick() {
window.focus();
bug = new Image();
bug.src = 'http://forumgaming.com/track_click.php?pg=' + escape(document.title) + '&advertisement=' + escape(window.status);
}
</script>
track_click.php stores the info in the DB, it works fine as I have tested it by browsing to that page entering the url varriables manually
Advert displayed with iFrame:
<iframe src="../adsense.htm" frameborder=0 width=800 height=150 onFocus='logClick()'></iframe>
adsense.htm holds the adsense javascript provided by google. The advert displays ok but when clicked doesnt seem to be calling track_click.php with the appropriate variables. I have a feeling its the javascript function logClick(), but as I know nothing about javascript and got the code from a tutorial then I dont know whats wrong
heres the tutorial link by the way: http://www.icemelon.com/tutorials/17/Track_Google_Adsense_Clicks.htm
Thanks