简体   繁体   English

如何将Google Analytics(分析)添加到Meteor应用程序?

[英]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 /令牌。

okgrow:analytics okgrow:分析

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.

相关问题 使用dburles:google-maps流星包时,如何添加Google Maps Visualization库? - How do I add the Google Maps Visualization Library when using the dburles:google-maps Meteor package? 如何将LinkedIn登录添加到Meteor? - How do I add LinkedIn login to Meteor? 如何将“google-services.json”文件添加到Meteor / Cordova项目中? - How do I add ‘google-services.json’ file to a Meteor/Cordova project? 我应在哪里添加此Google Analytics(分析)自定义变量代码? - Where do I add this Google Analytics custom variable code? 如何在Extjs单页面应用中添加Google Analytics分析事件跟踪? - How to add google analytics event tracking in Extjs Single page App? 使用Meteor应用程序设置Google Analytics(分析):未安装跟踪错误 - Setup Google Analytics with Meteor App: Tracking not Installed Error 如何在Google Analytics(分析)中跟踪Google可视化图表事件? - How do I track Google visualization chart events in Google analytics? 如何在Meteor中为Google Map添加新标记? - How can I add new markers to Google Map in Meteor? 如何在 React JS 应用程序中使用 Google Analytics 代码? - How can I use Google Analytics code in React JS app? 使用铁路由器的Meteor中的Google Analytics - Google Analytics in Meteor with Iron Router
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM