简体   繁体   English

trigger.io-Google Analytics(分析)

[英]trigger.io — Google Analytics

How does one go about including Google analytics for Trigger.io-built apps? 如何将Google Analytics(分析)纳入Trigger.io构建的应用程序? I can see that the mobile web built with trigger.io would be just a matter of embedding the GA JS code. 我可以看到,使用trigger.io构建的移动网络仅是嵌入GA JS代码的问题。 But what about iOS or Android? 但是iOS或Android呢?

We have integrated the Flurry Analytics SDK as of our v1.4.19 platform release . v1.4.19平台版本开始,我们已经集成了Flurry Analytics SDK。 Documentation available here: http://docs.trigger.io/en/v1.4/modules/flurry.html 可在此处找到文档: http : //docs.trigger.io/en/v1.4/modules/flurry.html

It is also possible to integrate the Google Analytics native SDK (or any other analytics SDK) using the plugin system . 也可以使用插件系统集成Google Analytics(分析)原生SDK(或任何其他Analytics(分析)SDK)。

Simple answer: 简单答案:

You already answered your own question - embed the Google GA JS code. 您已经回答了自己的问题-嵌入Google GA JS代码。

Alternative answer: 替代答案:

Another alternative is that you could utilize forge.ajax and fire the .trackPageView method in the success callback. 另一种选择是,您可以利用forge.ajax并在成功回调中触发.trackPageView方法。 In this case you would have to add the proper domain permission in your config file. 在这种情况下,您将必须在配置文件中添加适当的域权限。

However, isn't GA tied to a specific domain (or group of domains)? 但是,GA是否不绑定到特定域(或一组域)? In the case of PhoneGap or trigger.io there is no domain name. 对于PhoneGap或trigger.io,没有域名。

Also, see this question & answer - 另外,请参阅此问题和答案-

Step by step to get Google Analytics working in PhoneGap 1.2.0 on iOS (phonegapalytics) 逐步让Google Analytics(分析)在iOS的PhoneGap 1.2.0中工作(phonegapalytics)

Embedding the JavaScript version of Google Analytics won't work - for some reason, the tracking calls don't fire any events, so you need to use the measurement API. 嵌入JavaScript版本的Google Analytics(分析)无法正常工作-由于某些原因,跟踪调用不会触发任何事件,因此您需要使用Measurement API。

I've created a plugin that allows you to use Google Analytics with Trigger.io on github, which you can use: http://bit.ly/1F3VM1J 我创建了一个插件,可让您在github上的Trigger.io中使用Google Analytics(分析),您可以使用: http : //bit.ly/1F3VM1J

The plugin uses the Request and Prefs module to send analytics data to Google, and it works with the realtime dashboard too. 该插件使用Request and Prefs模块将分析数据发送到Google,并且还可以与实时仪表板一起使用。 You can track screenviews and events only at the moment, but it should be sufficient for your application. 您目前只能跟踪屏幕浏览和事件,但这对于您的应用程序来说应该足够了。

To track a pageview, you can do the following: 要跟踪浏览量,您可以执行以下操作:

// send screenview tracking data
ga('send', 'screenview', 'App Load');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM