Android Referrer
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Google Play Install Referrer
Section titled “Google Play Install Referrer”On Android, getReferrer() connects to the Google Play Install Referrer service and returns data from the Play Store install record.
const result = await InstallReferrer.getReferrer();
console.log(result.referrer);console.log(result.clickTimestampSeconds);console.log(result.installBeginTimestampSeconds);console.log(result.googlePlayInstantParam);Returned Fields
Section titled “Returned Fields”| Field | Description |
|---|---|
platform | Always android. |
referrer | Raw Play install referrer string. |
clickTimestampSeconds | Client-side referrer click timestamp in seconds. |
installBeginTimestampSeconds | Client-side install begin timestamp in seconds. |
googlePlayInstantParam | Whether the user launched the app’s instant experience. |
Requirements
Section titled “Requirements”- The app must be installed from Google Play for real install referrer data.
- The device must have a Play Store version that supports the Install Referrer service.
- No Android runtime permission is required.
Error Cases
Section titled “Error Cases”The plugin rejects when the Play Store service is unavailable, unsupported, disconnected before returning a result, or returns an unexpected response.
Keep going from Android Referrer
Section titled “Keep going from Android Referrer”If you are using Android Referrer to plan native plugin work, connect it with Using @capgo/capacitor-install-referrer for the native capability in Using @capgo/capacitor-install-referrer, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives.