[英]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? 我看到我们不能直接在Meteor中将代码添加到HTML标记中,将Google Analytics(分析)添加到Meteor的一种好方法是什么? I googled it and there are many outdated resources, but the most up to date is a package called meteor-ganalytics.
我用Google搜索它,并且有许多过时的资源,但是最新的是一个名为meteor-ganalytics的软件包。 I'm not sure if it does directly that.
我不确定是否直接这样做。 Any help?
有什么帮助吗?
We've created a package that integrates Google Analytics, Mixpanel, KISSmetrics and other platforms under one API with Meteor. 我们创建了一个程序包,该程序包将一个流星API集成了Google Analytics(分析),Mixpanel,KISSmetrics和其他平台。
The package adds the packages and makes them ready-to-use in the Meteor. 程序包会添加程序包,并使它们可以在Meteor中立即使用。 All you need to do is add the package and and add your trackingIDs/tokens in settings.
您所需要做的就是添加软件包,并在设置中添加您的trackingID /令牌。
There is a package available meteor add datariot:ganalytics
that adds GA to Meteor. 有一个可用的包
meteor add datariot:ganalytics
将GA添加到Meteor。 It allows the user to configure analytics and set GA events. 它允许用户配置分析并设置GA事件。
Found here: https://github.com/datariot/meteor-ganalytics 在这里找到: https : //github.com/datariot/meteor-ganalytics
If you use Iron Router, you may then look at this package: 如果您使用Iron Router,则可以查看以下软件包:
https://atmospherejs.com/reywood/iron-router-ga https://atmospherejs.com/reywood/iron-router-ga
Install it, then add your Google Analytics account ID to settings.json
file 安装它,然后将您的Google Analytics(分析)帐户ID添加到
settings.json
文件中
then add 然后加
Router.configure({ trackPageView: true });
And it will stark tracking your routes. 并且它将完全跟踪您的路线。 No extra code required.
无需额外的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.