This page is not available in every language. Missing translations are disabled in the language selector.

Quick reference

Web Analytics Libraries Cheat Sheet

A quick reference guide for popular client-side web analytics libraries including Mixpanel and Google Analytics analytics.js.

· Published

A quick syntax reference for popular client-side web product analytics and tracking libraries.

Mixpanel

mixpanel.identify('284');
mixpanel.people.set({ $email: '[email protected]' });
mixpanel.register({ age: 28, gender: 'male' }); /* set common super properties */
mixpanel.track('Signed Up', {
  'Signup Type': 'Referral'
});

See: Mixpanel JavaScript SDK Documentation


Google Analytics (analytics.js)

ga('create', 'UA-XXXX-Y', 'auto');
ga('create', 'UA-XXXX-Y', { userId: 'USER_ID' });
ga('send', 'pageview');
ga('send', 'pageview', { 'dimension15': 'My custom dimension' });

See the dedicated Google Analytics Legacy APIs Cheat Sheet.

Related topics