Cordova plugin to retrieve referral content from Google play using Google Play Store's Install Referrer API.
cordova-plugin-play-installreferrer
Cordova plugin to retrieve referral content from Google play using Google Play Store’s Install Referrer API(Android)
The plugin exposes the following method:
installReferrer.getReferrer(success, error);
success: success callback
The response object will have the object which contains all the referrer details and some of the common attributes are following
. responseCode: response code(0/1/2)
. clickTs: Referrer link click time stamp
. installTs: Install time stamp
. isInstantExperienceLaunched: whether instant app launched or not
Notes
{
"clickTs": "0",
"installTs": "0",
"isInstantExperienceLaunched": "false",
"responseCode": "0",
"utm_medium": "organic",
"utm_source": "google-play"
}
{
"clickTs": "<valid_ts>",
"installTs": "<valid_ts>",
"isInstantExperienceLaunched": "false",
"responseCode": "0",
"utm_medium": "cpc",
"utm_source": "google"
}
The plugin can be installed via Cordova-CLI and is publicly available on NPM.
Execute from the projects root folder:
$ npm i cordova-plugin-play-installreferrer
$ cordova plugin add cordova-plugin-play-installreferrer
Or install a specific version:
$ npm i cordova-plugin-play-installreferrer@<latest_version>
$ cordova plugin add cordova-plugin-play-installreferrer@<latest_version>
Or install the latest head version:
$ cordova plugin add https://github.com/swayangjit/cordova-plugin-play-installreferrer.git
Or install from local source:
$ cordova plugin add <path> --nofetch --nosave --link