Adsense Click Pepper

My latest “spare-time” project has been creating an Adsense Click Pepper for Shaun Inman’s excellent Mint web stats package. A pepper is a plugin that can be used to extend the features of the base Mint project.

The pepper I have created will track hits on your Google Adsense ads from Internet Explorer and Firefox. The pepper will track the page that the click occured on, the ad unit number (if you have more than one ad unit on the page) and the size of the ad unit.

Download Adsense Click Pepper now!


The clicks should be very accurate on IE as IE supports tracking of the focus event on iframe elements. Firefox is a different story as for Cross Site Scripting security reasons, FF does not allow events to be attached to iframes that have an off-domain source. For that reason, I am tracking clicks on the Adsense iframe by determining if the cursor location is over the iframe just before the page unloads. It seems to work pretty well, but misses every now and again.

I look forward to feedback and making some adjustments!

32 thoughts on “Adsense Click Pepper

  1. Nice work Jim.

    Would you consider giving your table a prefix unique to you? Also, you’ll want to change cfg() to getCfgValue() for future versions of Mint.

  2. i loved this tool, after i update my mint i can not use this fantastic plugin, please update the great tool :-)R

  3. Good work ! Thanks !
    Just a little problem, if you put the mouse on a ads unit and then push F5 (refresh) on your keybord it count a click :/ (with FF, I dont know with IE).

  4. I am totally confused, I like to track adsense clicks and I download the above zip file and how to install, where to install and where i will get the results???

    any help ?

  5. I’d love to be able to pass additional data with the click event. for example, I keep the user’s original referer in a session object. if I could track that along with the adsense click event, then suddenly I know exactly how much revenue each referer has sent me.

  6. Hi Jim–

    I can install other peppers just fine, but for some reason with yours, I don’t get the “Install” link. Any idea why that might be?

  7. This script can be improved for Firefox.
    The method to detect adsense click based on the mouse position does not work well, in particular when the page has been scrolled. A better method might be to attach event handlers to iframes for events mouseover and mouseout. That way, you know that the mouse is over an iframe. If you get a beforeunload event when the mouse is over an ad, chances are that this ad has been clicked.

  8. Hello, i don’t speak very good english. I download it and then… what??? What i can install both plugins? Please, help me (also i speak spanish)!!!! Well, Good Luck!!!

  9. I’ve downloaded the tool but I’m not really sure about how to get it up and running. Do you think you could assist me in setting it up?

Comments are closed.