问题描述:

How does one go about including Google analytics for Trigger.io-built apps? I can see that the mobile web built with trigger.io would be just a matter of embedding the GA JS code. But what about iOS or Android?

网友答案:

Simple answer:

You already answered your own question - embed the Google GA JS code.

Alternative answer:

Another alternative is that you could utilize forge.ajax and fire the .trackPageView method in the success callback. 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)? In the case of PhoneGap or trigger.io there is no domain name.

Also, see this question & answer -

Step by set to get Google Analytics working in PhoneGap 1.2.0 on iOS (phonegapalytics)

网友答案:

We have integrated the Flurry Analytics SDK as of our v1.4.19 platform release. Documentation available here: 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.

网友答案:

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.

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

The plugin uses the Request and Prefs module to send analytics data to Google, and it works with the realtime dashboard too. 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');
相关阅读:
Top