v3.0.0Published 9 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project. integration for Meteor

  • Note: We've switched to the official versioning scheme for tracking upstream packages (1.1.0_1). Unfortunately, meteor will pick the highest version (in this case 3.0.0) which is old and should not be used. Please choose the latest 1.x version explicitly). *

Works on client and server.


The snippet is copied almost verbatim from the docs, however, analytics is exposed via the Meteor package rather than window.

Snippet version is 2.0.9.


Using official analytics-node npm module.


Almost all the apis are available on both client and server

The un-inited analytics object is available for use as per normal.

First, initialize analytics:


Then, you could send a pageview from IronRouter:

Router.onRun(function() {;

To identify the user, you'd setup an autorun:

Meteor.startup(function() {
  Tracker.autorun(function(c) {
    // waiting for user subscription to load
    if (! Router.current() || ! Router.current().ready())

    var user = Meteor.user();
    if (! user)

    analytics.identify(user._id, {
      email: user.emails[0].address


Aliasing anonymous users to a registered user when their account is created:

  email: email,
  password: password,
  profile: {
    name: name
}, function(error) {
  if (! error) {
  } else {
    alert('Error creating account!\n' + EJSON.stringify(error));

Tracking an event is as simple as:

analytics.track('Purchased T-Shirt', {
  name: 'The Cake is a Liar',
  revenue: 14.99