Reputation: 416
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
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
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.
Upvotes: 3
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