2 title: Google Analytics
5 archived: This sheet describes an older version of Google Analytics (UA).
11 ga('create', 'UA-XXXX-Y', 'auto');
12 ga('send', 'pageview');
17 // [..., category, action, label, value (int), noninteraction (bool)]
18 _gaq.push(['_trackEvent', 'Videos', 'Play', 'Birthday video', true])
19 _gaq.push(['_trackEvent', 'Projects', 'Donate', 'Project name'])
20 _gaq.push(['_trackEvent', 'Accounts', 'Login'])
23 // , , category, action, label, value (int)
24 ga('send', 'event', 'button', 'click', 'nav buttons', 4);
28 // [..., index, name, value, scope (optional)]
29 _gaq.push(['_setCustomVar', 1, 'Logged in', 'Yes', 2]);
31 // Scope = 1 (visitor), 2 (session), 3 (page, default)
35 - <https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables>
36 - <https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide>