Search code examples
javascriptgoogle-analyticsanalytics

Asynchronous google analytics


Hi there: When you need to register some javascript activity from your web site into google analytics they say you may use (for example):

_gaq.push(['_trackEvent', 'Param1', 'Params2']);

or

_gaq.push(['_trackPageView', 'URL']);

Does anybody knows this function call works? Does it make an Ajax request to Google in order to send the data? Does it store the info and pushes it to the server on unload event?

Thanks.


Solution

  • Thanks a lot to yc who finally gave the answer I was looking for. I just put it here so I can mark this question as solved.

    As he pointed, they make a clever approach to this problem requesting an image file in their servers passing some parameters; this way they can avoid cross-domain issue. The link he wrote (this one) also has a reference to page from analytics google group with more info (Analytics Google group)