ASP.NET 2.0 Resources

Powered by Blogger

Free AdSense click tracking script updated!

I have updated the AdSense click tracking script. There is now support for advanced click tracking of AdSense blocks in different languages and some other minor improvements. I have collected data about as many languages the Google AdSense uses as I could. The list is not yet complete, but I think all the most used languages are covered. You can download this free adsense tracking script v2 right now.

If you don't know what i am talking about, here is a little background for you. This script allows you to track clicks on Google AdSense advertisements on your websites and report every single click or AdLinks keyword click to online Google Analytics. Google Analytics interface supports more advanced reporting then AdSense itself. This could help you to optimize you AdSense placement, improve your CTR and eCPM and the best part it's all free.

The installation instructions and other information can be found in my previous blog post Tracking AdSense clicks with Google Analytics. The is also whole tutorial how to interpret tracking results with google analytics in one of my posts: Analyzing and Interpreting AdSense results with Google Analytics.

There is a little difference from previous tracking script version. To support additional languages, the script is now saved in utf-8 encoding. Be sure to preserve this encoding when editing this script, otherwise it won't function correctly. It's also a good idea to reference this javascript with correct charset from your web pages (see the following example).



  • Hi Dolly,

    I just installed the new version of your Adsense tracker.
    It is a great +++ with the languages !

    I like to save the 'reportedUrl' also to my database.

    I have a 'global' funtion witch fills the databasse with lots of information.

    Public Sub FillDatabase (byval....etc)
    'write info to the database
    'write 'reportedUrl' to the database
    End sub

    How can I change the 'reportToGoogleAnalytics(reportedUrl)) '
    into 'FillDatabase(reportedUrl)' located in Results.aspx.vb

    I hope you can help me.

    Best regards,

    I am working with Wisual Web Developer 2005 Express in VB

    By Blogger Bonaparte, at 6:13 PM  

  • Hi,
    you can do this with dynamic with bug image from javascript. Something similar to...

    function fillDatabase(reportedUrl) {
    bug = new Image();
    bug.src = 'results.aspx?ref=' + document.location + '&url=' + reportedUrl;

    The next step is to process ref and url querystring parameters within your ASP.NET application.

    By Blogger dolly, at 8:36 AM  

  • Hi Dolly,

    Thanks for your quick reply.

    I tried your code and I can capture the 'reportedUrl'

    But still have a small problem...

    Your code is in search.aspx

    The code to handle 'reportedUrl' is in results.aspx (both in directory C:\___Test\..).

    bug.src = 'search.aspx?ref=' + document.location + '&url=' + reportedUrl // is working fine
    bug.src = 'results.aspx?ref=' + document.location + '&url=' + reportedUrl // is not working ?!

    I tried ...
    bug.src = 'results.aspx?ref=' + document.location + '&url=' + reportedUrl
    bug.src = '..results.aspx?ref=' + document.location + '&url=' + reportedUrl
    bug.src = '..\results.aspx?ref=' + document.location + '&url=' + reportedUrl
    bug.src = 'http://localhost:4470/___Test/results.aspx?ref=' + document.location + '&url=' + reportedUrl
    and a few others

    Maybe it is not possible to use bug.src to send 'reportedUrl' to a different page ??

    Best regards,


    By Blogger Bonaparte, at 11:05 AM  

  • Hi, Dolly.

    Many thanks for your wonderful work. Your script supports many languages and I enjoyed it.

    I found your script are missing one suffix for Korean language. In the google adsense, there are two prefixes which are 'go to' and 'View ads about'. The first one is the prefix of AdSense for contents and the latter one is the prefix of AdSense for links.

    In case of Korean, only 'View ads about'is included in the lngFilter. The modified version that includes Korean suffix for 'go to' is located at I hope this is included in your next version of astracker.

    By Blogger Joongsoo, at 10:42 AM  

  • Hi Dolly,

    I've installed the script using an absolute URI in the goal setup and for some reasons only links from link blocks are tracked (not from ad blocks).

    I've now setup a relative URI (/asclick) and I'll see if anything changes.

    By the way, any chance to get this to work with the new Analytics interface?

    Keep up the good work


    By Blogger Unknown, at 10:37 AM  

  • Hi there,

    Thanks for wonderful article. Can you please help me with my problem? I have two systems capturing visitor activity for same site. One in PHP and one in ASP.NET(VB).

    So, every page has following two javascripts just before the closing body tag.

    var _ref=escape(document.referrer),_res,_dep;
    if (self.screen){_res=screen.width+"x"+screen.height;_dep=screen.colorDepth;}
    else if ( {var j=java.awt.Toolkit.getDefaultToolkit();var s=j.getScreenSize();_res=s.width+"x"+s.height; }
    document.write("<img src='"+q+"' width='1' height='1' border='0' />");

    var _ref=escape(document.referrer), _res, _dep;
    if (self.screen)
    else if (
    var j=java.awt.Toolkit.getDefaultToolkit();
    var s=j.getScreenSize();

    q = '?SiteID=2&ref='+_ref+'&res='+_res+"&dep="+_dep;
    document.write("<img src='" + q + "' width='1' height='1' border='0' />");

    The probelm here is, both system captures all the pages, but .NET system can't capture the pages from GoogleSyndication. While that referrer is being recorded in PHP system. I cant guess the reason why?

    Can you give me some suggestion?


    By Blogger MD [Maulik Dave], at 12:05 PM  

  • Nice article you got there dolly. I am searching for tracking tools and i have dropped by here and found version 1 and version 2 of your tracking system. I will create a link to your sit from my blog.

    Money Making and Blogging Tips

    By Blogger Charles, at 3:54 PM  

  • ===>>

    Here's your chance to make $40,000 per month with
    Adsense by being lazy.....

    Wanna Find out How I, By Being a Lazy Ass Make $40,000/Month
    (Yep, that's 40,000 USD) Every Month Like Clockwise From My


    The Website Is.

    * Highly Optimized
    * Content Rich
    * Profit Pulling
    * Fully Automated

    Here's What You Get:

    A Huge Money Making Website
    Integrated with Adsense ads,
    dynamic feeds and over a thousand content pages.

    My Free Traffic Report
    Methods I use to get a lot of traffic, almost instantly.

    Free Email Tips
    You will get some EXTRA tips on promoting your new website by email.

    Setup and Hosting Help
    Even though you get full easy to follow setup instructions.
    If you still have trouble you can contact us
    we will set up and host your website for you.


    As an special offer, I am offering my complete Adsense Treasure System A fully automated website which makes you money while you sleep.

    Finally a tool for you to make some serious money.

    Get Your Copy Now... Click here


    Ready Made Website

    Shah Rukh Khan



    India's Online Shopping Mall

    Online Shopping Mall

    Buy Online

    Link Directory
    The Most Responsive FREE Safelist
    Make Money Online
    Master Resell Rights eBooks
    Bollywood Sargam

    By Anonymous Anonymous, at 1:12 PM  

  • The flight attendant cover letter will help you in improving many things related to specific job.I hope it will work.

    By Blogger aliyaa, at 3:05 PM  

Post a Comment

<< Home

Created dolly