Integrating the SDK into your app
The adjust SDK automatically registers with the Cordova events deviceready
, resume
and pause
.
In your index.js
file after you have received the deviceready
event, add the following code to initialize the adjust SDK:
var adjustConfig = new AdjustConfig("{YourAppToken}", AdjustConfig.EnvironmentSandbox);
Adjust.create(adjustConfig);
Replace {YourAppToken}
with your app token. You can find this in your [dashboard].
Depending on whether you build your app for testing or for production, you must set environment
with one of these values:
AdjustConfig.EnvironmentSandbox
AdjustConfig.EnvironmentProduction
Important: This value should be set to AdjustConfig.EnvironmentSandbox
if and only if you or someone else is testing
your app. Make sure to set the environment to AdjustConfig.EnvironmentProduction
just before you publish the app. Set it
back to AdjustConfig.EnvironmentSandbox
when you start developing and testing it again.
We use this environment to distinguish between real traffic and test traffic from test devices. It is very important that you keep this value meaningful at all times! This is especially important if you are tracking revenue.
Basic Integration
Additional Features