2 title: Google Analytics
8 ga('create', 'UA-XXXX-Y', 'auto');
9 ga('send', 'pageview');
14 // [..., category, action, label, value (int), noninteraction (bool)]
15 _gaq.push(['_trackEvent', 'Videos', 'Play', 'Birthday video', true])
16 _gaq.push(['_trackEvent', 'Projects', 'Donate', 'Project name'])
17 _gaq.push(['_trackEvent', 'Accounts', 'Login'])
20 // , , category, action, label, value (int)
21 ga('send', 'event', 'button', 'click', 'nav buttons', 4);
25 // [..., index, name, value, scope (optional)]
26 _gaq.push(['_setCustomVar', 1, 'Logged in', 'Yes', 2]);
28 // Scope = 1 (visitor), 2 (session), 3 (page, default)
30 https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables
31 https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide