Adjust
This is the Ionic Cordova SDK of Adjust™. You can read more about Adjust™ at adjust.com.
Requires Cordova plugin: com.adjust.sdk
. For more info, please see the Adjust Cordova SDK
Repo: https://github.com/adjust/cordova_sdk
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add com.adjust.sdk $ npm install --save @ionic-native/adjust@4
- Add this plugin to your app's module
Supported platforms
- Android
- iOS
Usage
import { Adjust, AdjustConfig, AdjustEnvironment } from '@ionic-native/adjust';
constructor(private adjust: Adjust) { }
...
const config = new AdjustConfig('APP-TOKEN-HERE', AdjustEnvironment.Sandbox);
config.logLevel = AdjustLogLevel.Verbose;
// Set other config properties.
adjust.create(config);
Instance Members
create(config)
This method initializes Adjust SDK
Param | Type | Details |
---|---|---|
config |
AdjustConig
|
Adjust config object used as starting options |
trackEvent(event)
This method tracks an event
Param | Type | Details |
---|---|---|
event |
AdjustEvent
|
Adjust event object to be tracked |
setOfflineMode(enabled)
This method sets offline mode on or off
Param | Type | Details |
---|---|---|
enabled |
boolean
|
set to true for offline mode on |
appWillOpenUrl(url)
By making this call, the Adjust SDK will try to find if there is any new attribution info inside of the deep link and if any, it will be sent to the Adjust backend.
Param | Type | Details |
---|---|---|
url |
string
|
URL of the deeplink |
setEnabled(enabled)
You can disable/enable the Adjust SDK from tracking by invoking this method
Param | Type | Details |
---|---|---|
enabled |
boolean
|
set to false to disable SDK |
setPushToken(pushToken)
To send us the push notification token, add the following call to Adjust whenever you get your token in the app or when it gets updated. Push tokens are used for Audience Builder and client callbacks, and they are required for the upcoming uninstall tracking feature.
Param | Type | Details |
---|---|---|
pushToken |
string
|
push token value |
isEnabled()
Check if the Adjust SDK is currently enabled by calling this function
Returns: Promise<boolean>
gdprForgetMe()
In accordance with article 17 of the EU’s General Data Protection Regulation (GDPR), you can notify Adjust when a user has exercised their right to be forgotten. Calling the following method will instruct the Adjust SDK to communicate the user’s choice to be forgotten to the Adjust backend
getGoogleAdId()
Function used to get Google AdId
Returns: Promise<string>
Returns a promise with google AdId value
getAmazonAdId()
If you need to obtain the Amazon Advertising ID, you can make a call to this function.
Returns: Promise<string>
Returns a promise with anazib adv. ID
getIdfa()
To obtain the IDFA, call this function
Returns: Promise<string>
Returns a promise with IDFA string value
getAdid()
For every device with your app installed on it, the Adjust backend generates a unique Adjust device identifier (adid). In order to obtain this identifier, call this function
Returns: Promise<string>
Returns a promise with adid value
getAttribution()
If you want to access information about a user’s current attribution whenever you need it, you can make a call to this function
Returns: Promise<AdjustAttribution>
Returns a promise with AdjustAttribution object
getSdkVersion()
Get the information about version of the SDK used
Returns: Promise<string>
Returns a promise with sdk version information
addSessionCallbackParameter(key, value)
Method used to add session callback parameters
Param | Type | Details |
---|---|---|
key |
key |
|
value |
value |
removeSessionCallbackParameter(key)
Remove a specific session callback parameter by passing the desiring key to this method
Param | Type | Details |
---|---|---|
key |
key |
resetSessionCallbackParameters()
If all keys and values from the session callback parameters have to be removed, call this method
addSessionPartnerParameter(key, value)
Method used to add session partner parameters
Param | Type | Details |
---|---|---|
key |
key |
|
value |
value |
removeSessionPartnerParameter(key)
Remove a specific session partner parameter by passing the desiring key to this method
Param | Type | Details |
---|---|---|
key |
key |
resetSessionPartnerParameters()
If all keys and values from the session partner parameters have to be removed, call this method
sendFirstPackages()
This method call will make the Adjust SDK send the initial install session and any events created, if they were not sent after delay start was set and it’s delay expired.
AdjustEvent
Instance Members
setRevenue()
addCallbackParameter()
addPartnerParameter()
setTransactionId()
setCallbackId()
AdjustConfig
Instance Members
setAppSecret()
setDelayStart()
setLogLevel()
setDefaultTracker()
setSendInBackground()
setShouldLaunchDeeplink()
setEventBufferingEnabled()
setUserAgent()
setDeviceKnown()
setProcessName()
setAttributionCallbackListener()
setEventTrackingSucceededCallbackListener()
setEventTrackingFailedCallbackListener()
setSessionTrackingSucceededCallbackListener()
setSessionTrackingFailedCallbackListener()
setDeferredDeeplinkCallbackListener()
AdjustAttribution
Param | Type | Details |
---|---|---|
trackerToken |
string
|
|
trackerName |
string
|
|
network |
string
|
|
campaign |
string
|
|
adgroup |
string
|
|
creative |
string
|
|
clickLabel |
string
|
|
adid |
string
|
AdjustSessionSuccess
Param | Type | Details |
---|---|---|
message |
string
|
|
timestamp |
string
|
|
adid |
string
|
|
jsonResponse |
string
|
AdjustSessionFailure
Param | Type | Details |
---|---|---|
message |
string
|
|
timestamp |
string
|
|
adid |
string
|
|
willRetry |
boolean
|
|
jsonResponse |
string
|
AdjustEventSuccess
Param | Type | Details |
---|---|---|
message |
string
|
|
timestamp |
string
|
|
adid |
string
|
|
eventToken |
string
|
|
callbackId |
string
|
|
jsonResponse |
string
|
AdjustEventFailure
Param | Type | Details |
---|---|---|
message |
string
|
|
timestamp |
string
|
|
adid |
string
|
|
eventToken |
string
|
|
willRetry |
boolean
|
|
callbackId |
string
|
|
jsonResponse |
string
|