encode the dash or not

2019-07-14 18:36发布

问题:

I am trying to use Google Analytics in my Phonegap Android APP

I followed the instructions in this repo

https://github.com/DoersGuild/Cordova-Android-Analytics

every thing is ok and success message is returned, but unfortunately I waited 24 hours and no updates in reporting in Google Analytics account

Here it is the file analytics.xml file:

<?xml version="1.0" encoding="utf-8"?>

<!-- Replace placeholder ID with your tracking ID -->
<string name="ga_trackingId">UA-XXXXXXXX-X</string>

<!-- Disable Activity tracking, not used in Cordova which only has one activity -->
<bool name="ga_autoActivityTracking">false</bool>

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

<!-- Anonymize tracking -->
<bool name="ga_anonymizeIp">true</bool>

<!-- Enable debugging -->
<bool name="ga_debug">true</bool>

</resources>

instead the UA-XXXXXXXX-X track id, I wrote my account track id

My question is should I keep it with dash, or I should to encode the dash to be UA–XXXXXXXX–X

Thanks

回答1:

Per the Google Analytics Overview:

Important: Do not encode dashes in the ga_trackingId string. Doing so will prevent you from seeing any data in your reports.