Search code examples
androidandroid-activitygoogle-playbacktrackingaffiliates

How to pass a tracking ID to the apk on install


Simple as this,

My affiliates send users to my app in google play, on install my app picks up who sent that install.

Is that even possible?

Example: https://play.google.com/store/apps/details?id=com.netmarble.mherosgb&someid=AFFILIATEID

I know I can have GA but I dont need that, I need my application to "know" exactly who sent the user who installed it.


Solution

  • InstallReferrerReceiver is broadcast which will fire when an app is installed from the Google Play Store

    In onReceive method takes the referrer extra from the intent and breaks it down into key/value pairs to get all data from url.

    See following example for more help:

    Tracking install sources for Android apps