yimmy
yimmy

Reputation: 416

How do I add Google Analytics to a Meteor app?

I see that we cannot directly add code to our HTML tag in Meteor, what is a good/canon way of adding Google Analytics to Meteor? I googled it and there are many outdated resources, but the most up to date is a package called meteor-ganalytics. I'm not sure if it does directly that. Any help?

Upvotes: 0

Views: 2807

Answers (3)

romaroma
romaroma

Reputation: 658

If you use Iron Router, you may then look at this package:

https://atmospherejs.com/reywood/iron-router-ga

Install it, then add your Google Analytics account ID to settings.json file

then add

Router.configure({ trackPageView: true });

And it will stark tracking your routes. No extra code required.

Upvotes: 1

Tonys
Tonys

Reputation: 3399

We've created a package that integrates Google Analytics, Mixpanel, KISSmetrics and other platforms under one API with Meteor.

The package adds the packages and makes them ready-to-use in the Meteor. All you need to do is add the package and and add your trackingIDs/tokens in settings.

okgrow:analytics

Upvotes: 3

Lex
Lex

Reputation: 36

There is a package available meteor add datariot:ganalytics that adds GA to Meteor. It allows the user to configure analytics and set GA events.

Found here: https://github.com/datariot/meteor-ganalytics

Upvotes: 1

Related Questions