Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/swayangjit/cordova-plugin-play-installreferrer

Cordova plugin to retrieve referral content from Google play using Google Play Store's Install Referrer API.
https://github.com/swayangjit/cordova-plugin-play-installreferrer

android cordova cordova-plugin installreferrer ionic play-instalreferrer referrer referrer-api

Last synced: 3 months ago
JSON representation

Cordova plugin to retrieve referral content from Google play using Google Play Store's Install Referrer API.

Awesome Lists containing this project

README

        

# `cordova-plugin-play-installreferrer`


npm version

License




License



> Cordova plugin to retrieve referral content from Google play using Google Play Store's Install Referrer API(Android)

## API

The plugin exposes the following method:

```javascript
installReferrer.getReferrer(success, error);
```

#### Parameters:

* __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

* __error:__ error callback

**Notes**

- By default if the plugin method is called then the response will be like following

{
"clickTs": "0",
"installTs": "0",
"isInstantExperienceLaunched": "false",
"responseCode": "0",
"utm_medium": "organic",
"utm_source": "google-play"
}

- if the url is like following
https://play.google.com/store/apps/details?id=com.example.application
&referrer=utm_source%3Dgoogle %26utm_medium%3Dcpc and its clicked in a device having playstore then the response will look like following

{
"clickTs": "",
"installTs": "",
"isInstantExperienceLaunched": "false",
"responseCode": "0",
"utm_medium": "cpc",
"utm_source": "google"
}

## Installation

The plugin can be installed via [Cordova-CLI](https://cordova.apache.org/docs/en/dev/guide/cli/index.html#The%20Command-line%20Interface) and is publicly available on [NPM](https://www.npmjs.com/package/cordova-plugin-play-installreferrer).


Execute from the projects root folder:

```javascript

$ npm i cordova-plugin-play-installreferrer

$ cordova plugin add cordova-plugin-play-installreferrer

```

Or install a specific version:

```javascript

$ npm i cordova-plugin-play-installreferrer@

$ cordova plugin add cordova-plugin-play-installreferrer@

```

Or install the latest head version:

```javascript

$ cordova plugin add https://github.com/swayangjit/cordova-plugin-play-installreferrer.git

```

Or install from local source:

```javascript

$ cordova plugin add --nofetch --nosave --link

```