[英]How to implement Google Analytics in hybrid mobile apps?
I am writing a hybrid mobile app using HTML5, CSS and jQuery Mobile.我正在使用 HTML5、CSS 和 jQuery Mobile 编写一个混合移动应用程序。 I will use Cordova Js to convert the HTML5 app to native mobile apps for iOS and Android.
我将使用 Cordova Js 将 HTML5 应用程序转换为适用于 iOS 和 Android 的本机移动应用程序。 I want to use Google Analytics to track various activities performed by users.
我想使用 Google Analytics 来跟踪用户执行的各种活动。 I found that GA provides SDKs for native apps but not much was specified for hybrid apps.
我发现 GA 为原生应用程序提供了 SDK,但没有为混合应用程序指定太多。 Have you implemented tracking for Cordova or PhoneGap based apps?
您是否为基于 Cordova 或 PhoneGap 的应用程序实施了跟踪? Can you provide me some direction on how to do it?
你能给我一些关于如何去做的指导吗?
I use the ngCordova Google Analytics plugin.我使用 ngCordova 谷歌分析插件。 You don't need Angular or Cordova to use it http://ngcordova.com/docs/plugins/
你不需要 Angular 或 Cordova 来使用它http://ngcordova.com/docs/plugins/
The git and docs are here: https://github.com/danwilson/google-analytics-plugin git 和文档在这里: https : //github.com/danwilson/google-analytics-plugin
Easy to use.便于使用。
Warning!警告! When you set it all up leave it 24hrs to 'propagate' or whatever Google does.
当你把它全部设置好时,让它 24 小时“传播”或谷歌所做的任何事情。 People find its not working and go searching for solutions (which cannot be found) and then BAM the next day its all good.
人们发现它不起作用并去寻找解决方案(无法找到),然后第二天 BAM 一切都很好。
First, in 2019 and later you probably want to use Firebase for mobile app analytics.首先,在 2019 年及以后,您可能希望使用 Firebase 进行移动应用分析。
Google it.去谷歌上查询。
Second, no matter what you decided to use, Firebase or Analytics, you can其次,无论您决定使用 Firebase 还是 Analytics,您都可以
1) use plugin (there some of them for both Firebase and Analytics) 1) 使用插件(其中一些用于 Firebase 和 Analytics)
2) just include relative script in your index.html same way you do in web app. 2) 只需在您的 index.html 中包含相关脚本,就像您在 Web 应用程序中所做的那样。 In this case in Analytics console you should create 3 different apps (one for each platform), that you can be able to separate user activity on iPhone from Android and Web.
在这种情况下,您应该在 Analytics 控制台中创建 3 个不同的应用程序(每个平台一个),您可以将 iPhone 上的用户活动与 Android 和 Web 分开。
You can create a plugin to bridge between your JS and Native GA SDK.您可以创建一个插件来在您的 JS 和 Native GA SDK 之间架起桥梁。 There are some already written plugins for your reference
有一些已经写好的插件供大家参考
https://github.com/danwilson/google-analytics-plugin
https://github.com/danwilson/google-analytics-plugin
Checkout implementation on http://shashibadhuk.com/phonegap/implement-google-analytics-on-phonegap-mobile-app/在http://shashibadhuk.com/phonegap/implement-google-analytics-on-phonegap-mobile-app/上结帐实施
for为了
https://github.com/danwilson/google-analytics-plugin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.