Tracking Web Stats in Urchin 7 (local) and Google Analytics Simultaneously

Posted on 2011-04-20
Last Modified: 2013-12-07
My web server currently has Urchin 7 installed, and I am currently able to track stats both locally in Urchin and in my Google Analytics account using the following script just fine.

<script src="/urchin.js" type="text/javascript"></script>
<script type="text/javascript"> 

Open in new window

I want to leverage the new functionality in Google's new ga.js Tracking Script (custom variables and event tracking).  Following Google's instructions, it suggested converting it to the following asynchronous script and adding it to the header just before the closing </head> tag of all my pages.

<script type='text/javascript'>
       var _gaq = _gaq || [];
	['_setAccount', 'UA-XXXXXXXX-X'],
	['_setLocalGifPath', '/__utm.gif'],
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

Open in new window

The the new script, Google Analytics is reporting the traffic just fine, but Urchin is not.  All content areas in Urchin are reporting zero visitors and hits.  IIS is logging all of the traffic, it just appears that Urchin is not reading the logs right or there's something missing. I've debugged ga.js on my page using Google's debugging tool in Chrome, and there are no errors.  I've looked everywhere for a solution, and all recommendations I've tried do not work.  

The general consensus is that I should not use both the urchin.js tracking script at the same time as the ga.js tracking script.  That's the only thing I have not tried because just about everyone says that they will conflict and cause reporting issues on both sides.

What am I missing here?  Any help would be highly appreciated.
Question by:alxo

    Author Comment

    So I played around with this a bit more and found that the stats come up in Urchin when I switch the Visitor Tracking Method from UTM to IP+User-Agent.  Apparently, UTM is cookie based, so it leads me to think the problem lies in cookies somewhere.  I would much rather have stats/visitor information tracked via cookies (UTM), so if anyone can still help me figure this out that would be great.  

    Accepted Solution

    It turns out that our CMS was the culprit.  A call to the /__utm.gif file at the root of our site was redirecting to the file's real location on our server and slightly altering the log entry in IIS.  Just enough for Urchin not to recognize the cookie data.  Moving the __utm.gif to a location on our server that is not controlled by our CMS, and pointing the tracking script there resolved the issue.

    Author Closing Comment

    I was finally able to resolve the problem myself.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
    This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
    The viewer will learn how to dynamically set the form action using jQuery.
    Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now