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.
-
Why is this relevant? Or is it just for curiosity?jwueller– jwueller2010年12月21日 13:57:09 +00:00Commented Dec 21, 2010 at 13:57
-
It's curiosity and I was wondering about the risk of trackig mouse drag events if it's sending a request every time the event is raised.PaquitoSoft– PaquitoSoft2010年12月21日 15:25:06 +00:00Commented Dec 21, 2010 at 15:25
-
Or a user click 10 times (for example) in the same link in a row...PaquitoSoft– PaquitoSoft2010年12月21日 15:37:23 +00:00Commented Dec 21, 2010 at 15:37
2 Answers 2
_gaq acts as a queue so you can push commands before Analytics has fully loaded; once it has it will start executing what you've queued. See the docs.
4 Comments
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)
Comments
Explore related questions
See similar questions with these tags.