[英]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.