• 13Nov

    Google Analytics have added a slight tweak to their tracking code in the past 2 days to include a try catch block, which hopefully will result in any problems arising with contacting their server will not stop the page from loading. The small tweak adds a try catch block at the end of the code.

    New Google Analytics Tracking Code

    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
    document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

    try {
    var pageTracker = _gat._getTracker(“UA-xxxxxxx-1″);
    pageTracker._trackPageview();
    } catch(err) {}

    Old Google Analytics Tracking Code

    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”); document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

    var pageTracker = _gat._getTracker(“UA-xxxxxxx-1″);
    pageTracker._initData();
    pageTracker._trackPageview();

    Share and Enjoy:
    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • Google Bookmarks
    • StumbleUpon
    • Technorati
    • Slashdot
    • Yahoo! Buzz

    Posted by Lee @ 1:15 pm

7 Responses

WP_Orange_Techno

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.