I'm launching Google Play like this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.example"));
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(intent);
I'd like to include referrer data, as explained here: https://developers.google.com/analytics/devguides/collection/android/devguide#google-play-builder Unfortunetely it generates the url which leads to the google play website. What's the equivalent for the intent? I'd be thankful for a sample source code.
Thanks.
What is a Google Play install referrer? A Google Play install referrer is a string of numbers that is used to measure mobile app install ad performance on Android devices. If you're a web marketer, think of it like UTM parameters for mobile app installs.
You can use the Google Play Store's Install Referrer API to securely retrieve referral content from Google Play, such as: The referrer URL of the installed package. The timestamp, in seconds, of when a referrer click happened (both client- and server-side).
An install referrer, otherwise known as a Google install referrer, is an identifier unique to Android devices which enables marketers to attribute ad activity to media sources for Google Play Store apps (also supported for some other stores, such as the Huawei Store).
The Google Install Referrer is an Android-specific measurement technology that attributes clicks on Google Play Store app pages to the correlating app download. Google's Install Referrer framework sends an install referrer (or unique code string) to the Google Play store when an ad click has occurred.
Adding referrer data to Google Play links works the same for in-app links as it does for the web:
You can add referrer data via a referrer
parameter in your market URI, i.e.:
market://details?id=com.example&referrer=utm_source%3Dmyapp%26utm_medium%3Dcross-sell
If the user chooses to then install the app to which you linked, the Google Play app should pass the value of that referrer
parameter, if present, as a string extra in the com.android.vending.INSTALL_REFERRER
intent during the install.
Note that referrer data is not passed for remote installs initiated from the Google Play Store website.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With