Should Google Analytics Event Tracking trigger an XHR request?
I am trying to set up Google Analytics event tracking . This is my code:
var uid = getUUID();
function postGA() {
var sliderval = $("#slider-stock").slider("value");
_gaq.push('_trackEvent', uid, sliderval);
}
I notice that postGA()
Firebug does not log the XHR request on startup.
Is this normal or should I expect to see it? If the latter, is there something clearly wrong with my code?
source to share
You can see the request if the event tracking code was correct. See the Event Tracking Guide
Try:
_gaq.push(['_trackEvent', uid, sliderval]);
Install Chrome and Google Analytics Debugger . Look at the console (control, change, j) for event tracking handling.
If you don't see the event tracking there, then something is happening to the tracking code on the page.
source to share
I think it is loading into the Google Analytics tracking pixel - I can see it loading on my site in the Inspector (resource view). He called__utm.gif
Query string parameters appended to gif are described in:
http://code.google.com/apis/analytics/docs/concepts/gaConceptsOverview.html#gifParameters
source to share
This page should give you an idea of how analytics works.
http://code.google.com/apis/analytics/docs/concepts/gaConceptsOverview.html
source to share