简体   繁体   中英

Ionic on Android: How to get Google Play campaign tracking parameters?

I have a Ionic/Cordova app with Google Analytics plugin, setup for Google Play Store campaign tracking. UTM parameters flow to Google Analytics without a problem.

However, I would like to access those parameters from my application code, to personalize the experience based on source of installation, and/or use campaign information with third party tracking solutions.

Is there a simple way to receive Play Store campaign tracking in Cordova application code, hopefully without writing native code?

I achieved it months ago, but problably needs some modifications for the last analytics plugin

Using this plugin: https://github.com/tvhnet2014/PHONEGAP-android-referrer-plugin Allows to retrieve the tracking parameters into the native android code, and stores in the application shared preferences for later retrieval.

With this plugin https://github.com/chrisekelley/AppPreferences/ You can access the App preferences from the javascript, so voilá, you have the data into your javascript.

Problem: The first plugin uses a custom broadcastReceiver, so probably, it crashes with the broadcastReceiver of the analytics plugin, so you will have to modify one of the plugins, to use the same broadcastReceiver.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM