Does Google Analytics for Cordova still work?

2019-08-20 20:28发布

问题:

I have noticed that if you try configuring Google Analytics for a mobile app - it points you to Firebase Analytics.

Can Google Analytics still be used for a Cordova app? If yes - shall it set as separate web property to track? What should be the site URL?

回答1:

Yes. I recently used Google Analytics for Ionic3 app. One important thing I was missing initially was to create account for mobile app in Google Analytics. If you use website account, GA events will not be fired from mobile devices.

You can use this Cordova plugin for GA.

Follow steps mentined bwlow to create GA account for mobile app.

1. Go to Admin panel from side bar.

2. Create new account

3. Select account type as Mobile App



回答2:

The website doesn't matter when configuring your GA property. You can use the web libraries like gtag.js or analytics.js just fine. Type mywebsite.com in the field, it simply doesn't matter.