简体   繁体   English

应用中的Google Analytics(分析)SDK

[英]Google Analytics SDK in your app

I followed the instructions here: 我按照这里的说明进行操作:

https://developers.google.com/analytics/devguides/collection/android/v3/ https://developers.google.com/analytics/devguides/collection/android/v3/

And I implemented the analytics.xml file as: 我将analytics.xml文件实现为:

<resources>
 <!--Replace placeholder ID with your tracking ID-->
 <string name="ga_trackingId">UA-XXXX-Y</string>

 <!--Enable automatic activity tracking-->
 <bool name="ga_autoActivityTracking">true</bool>

 <!--Enable automatic exception tracking-->
 <bool name="ga_reportUncaughtExceptions">true</bool>
</resources>

In the end it says "Important: Do not encode dashes in the ga_trackingId string. Doing so will prevent you from seeing any data in your reports." 最后,它说:“重要:不要在ga_trackingId字符串中对破折号进行编码。这样做会阻止您在报告中看到任何数据。”

Does that mean I should leave out the dashes and put something like UAXXXXY? 这是否意味着我应该省略破折号并放入UAXXXXY之类的东西? In all other examples, I saw online, people used dashes? 在所有其他示例中,我在网上看到有人用破折号吗? Clarification please 请澄清

No, it means that you can just leave it be like it looks. 不,这意味着您可以保留它的外观。

<string name="ga_trackingId">UA-XXXX-Y</string>

The reminder is because Android Lint may prompt you to use encoded dashes instead of "-". 提醒您,因为Android Lint可能会提示您使用编码的破折号而不是“-”。 You can simply ignore it. 您可以简单地忽略它。

Your lint checker may warn you about the use of the figure dash ('-') in your tracking ID. 您的棉绒检查器可能会警告您有关跟踪ID中使用数字破折号('-')的情况。 You can suppress that warning by adding additional attributes to your tag. 您可以通过向标签添加其他属性来抑制该警告。

Add this : <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyDashes"> 添加此内容: <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyDashes">

Hope this helps. 希望这可以帮助。

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

相关问题 Google Analytics(分析)Android SDK - Google Analytics Android SDK 新的Google AnalyticsSDK 4 - New Google Analytics SDK 4 Google Analytics(分析)Android SDK /例外报告:“ myParser代表您对ExceptionParser的实现” - Google Analytics Android SDK / Exceptions report : “myParser represents your implementation of ExceptionParser” Android 应用程序和谷歌分析 - Android app and google analytics 使用Google Analytics(分析)收集数据并发送到您的服务器 - Collect data with google analytics and send to your server Google Analytics(分析)Android SDK:跟踪我的应用版本和设备型号名称 - Google Analytics Android SDK: Tracking My App Version & Device Model Name 适用于Android应用的Google Analytics SDK V2:新用户,回访用户,活跃用户,会话让我感到困惑 - Google Analytics SDK V2 for Android App: New users, returning users, active users, sessions are confusing me SDK工具更新后,Android应用程序崩溃(NoClassDefFound,谷歌分析) - Android app crashes after SDK-tools update (NoClassDefFound, google analytics) 如何使用 Firebase SDK 向 Google Analytics 报告在移动应用中进行但离线支付的购买 - How to report to Google Analytics a purchase made in a mobile app but paid offline, using Firebase SDK 在Android应用中添加Firebase Analytics和Google Analytics - Adding Firebase Analytics and Google Analytics in Android App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM