Google Analytics trouble
I've been helping a client setup Google Analytics, specifically adding the e-commerce tracking. As with most analytics packages, stats are updated as part of a batch every few hours so it's tricky to troubleshoot the code when things aren't going well.
I was getting the tracking code to work, even on the SSL encrypted pages but the e-commerce tracking piece wasn't reporting any revenue. The tracking code is offered in two flavors, either an inline chunk of script to execute or called from the page onload function. To minimize disruption to the dsp_header.cfm in use throughout the site I thought I would add the inline code on the receipt page instead. No dice. Here is the problem: it fails silently on an AJAX call so I was stuck. LiveHTTPHeaders to the rescue. This neat little Firefox plugin works like Fiddler but is built into your browser. Turn it on and each HTTP request is logged either in the sidebar or a new tab.
With LiveHTTPHeaders turned on it became clear the inline JavaScript fragment didn't work so I moved my call to the dsp_header.cfm file with a condition based on whether you were viewing a receipt page or not. LiveHTTPHeaders cheerfully reported that I was now sending data to Google. All I need to do now is wait 4 hours to see if the data shows up.
Really loving Google Analytics - has anyone else used it? How does it stack up to other analytics packages you have seen? I love the custom funnel pages to be able to track e-commerce activity and the cross-tabbing of most data points to be able to dig in by city, country etc.