Tracking script for AdSense

N

Noël®

Hi all,

I'm using the following code to track clicks on one of my sites that is
running AdSense.

<script type="text/javascript"><!--

function hit() {
window.focus();
if (window.status) {
img = new Image();
img.src = 'log.cfm?ref=' + escape(document.location) + '&link=' +
escape(window.status);
};
};
document.getElementById("google_ads_frame").onfocus = hit;

//--></script>

All is working fine in IE (The log.cfm file keeps track of everything), but
NOT in Opera and Mozilla Firfox (and I guess some other browsers)

The problem is I think the "onFocus" event handler.

Any suggestions on how I can get this small bit of code to work with more
browsers?

Small note. The code you see is placed right after the AdSense code itself
and there are no changes made in the AdSense code itself.

Noel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top