Skip to content

Android 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);
FieldDescription
platformAlways android.
referrerRaw Play install referrer string.
clickTimestampSecondsClient-side referrer click timestamp in seconds.
installBeginTimestampSecondsClient-side install begin timestamp in seconds.
googlePlayInstantParamWhether the user launched the app’s instant experience.
  • 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.

The plugin rejects when the Play Store service is unavailable, unsupported, disconnected before returning a result, or returns an unexpected response.

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.