To track referral installs from the Android market, you can use the built-in Google Play Install Referrer API. This API provides a way to securely retrieve referral information about the installation.
Here are the steps to track referral installs:
- Implement the Google Play Install Referrer Library: Add the Google Play Install Referrer Library to your app's build.gradle file. This library will help you access the install referrer information.
- Initialize the Install Referrer Client: In your app's code, create an instance of the InstallReferrerClient using the Play Install Referrer client API.
- Connect and retrieve the install referrer information: Connect to the Install Referrer service using the InstallReferrerClient's startConnection() method. Once connected, you can retrieve the install referrer information using the InstallReferrerClient's getInstallReferrer() method.
- Process the install referrer data: Extract and process the desired information from the install referrer data. The install referrer data typically includes details such as the referrer URL, campaign name, source, and medium.
- Report and track the referral installs: Send the extracted install referrer data to your analytics system or marketing platform for tracking and analysis. This data can help you track the effectiveness of your referral campaigns.
Note: It's important to handle the install referrer data quickly and efficiently, as it's only available for a limited time after the app installation.
By implementing these steps, you can effectively track referral installs from the Android market using the Google Play Install Referrer API.