javascript - How do you use Google Analytics / _trackEvent on Mobile Safari (iPad)? -
i've been looking use google analytics _gaq.push()
function on single-page javascript application targeting ipad (in particular, mobile safari).
my page loads once , continues load data asynchronously user uses application. want track interactions user moves through application, decided on asynchronous api (_gaq.push()
).
i've heard method, ga data gets pushed on document unload. if true, have doubts whether work on mobile safari user might not unload document long time.
is best way want, , if not, preferred way push finely-tracked events google analytics application in timely manner?
thanks.
ga data not sent on document unload; there no association @ between document unload , google analytics.
when using async syntax, google analytics loaded dom asychronously wherever put it. @ same time, _gaq.push()
creates queue of functions execute once google analytics loaded, executed in sequence. of happens without regard document unload, onload, ready, etc.
when queue reaches tracking function (_trackpageview
, _trackevent
, _tracksocial
, etc.), executes request remote pixel, __utm.gif
, google uses generate logs parsing , processing analytics data.
once ga.js
loaded, _gaq.push()
acts immediate queue; meaning, if continue generating _gaq.push()
within application when want track things, tracking requests made immediately.
Comments
Post a Comment