Adjust
Learn how to set up integration with Adjust
To integrate Adjust go to Integrations > Adjust and set credentials.
Adjust works a bit differently from other platforms. You need to manually create events in Adjust dashboard, get event tokens, and copy-paste them to appropriate events in Adapty.
Open your Adjust dashboard and you'll see your apps.
You may have different Adjust applications for iOS and Android, so in Adapty you have two independent sections for that. If you have only one Adjust app, just fill in the same information
Copy App Token and paste it to Adapty.
Now you need to find event tokens for all events that you want Adapty to send. To do that go to All Settings.
Copy event token and paste to Adapty.
Important:
If you have enabled OAuth authorization on the Adjust platform, it is mandatory to provide an OAuth Token during the integration process.
SDK configuration
It's very important to send Adjust attribution data from the device to Adapty using Adapty.updateAttribution()
SDK method. The example below shows how to do that.
// Find your implementation of AdjustDelegate
// and update adjustAttributionChanged method:
func adjustAttributionChanged(_ attribution: ADJAttribution?) {
if let attribution = attribution?.dictionary() {
Adapty.updateAttribution(attribution, source: .adjust)
}
}
val config = AdjustConfig(context, adjustAppToken, environment)
config.setOnAttributionChangedListener { attribution ->
attribution?.let { attribution ->
Adapty.updateAttribution(attribution, AdaptyAttributionSource.ADJUST) { error ->
if (error != null) {
//handle error
}
}
}
}
Adjust.onCreate(config)
import 'package:adjust_sdk/adjust.dart';
import 'package:adjust_sdk/adjust_config.dart';
AdjustConfig config = new AdjustConfig('{YourAppToken}', AdjustEnvironment.sandbox);
config.attributionCallback = (data) async {
var attribution = Map<String, String>();
if (data.trackerToken != null) attribution['trackerToken'] = data.trackerToken!;
if (data.trackerName != null) attribution['trackerName'] = data.trackerName!;
if (data.network != null) attribution['network'] = data.network!;
if (data.adgroup != null) attribution['adgroup'] = data.adgroup!;
if (data.creative != null) attribution['creative'] = data.creative!;
if (data.clickLabel != null) attribution['clickLabel'] = data.clickLabel!;
if (data.adid != null) attribution['adid'] = data.adid!;
if (data.costType != null) attribution['costType'] = data.costType!;
if (data.costAmount != null) attribution['costAmount'] = data.costAmount!.toString();
if (data.costCurrency != null) attribution['costCurrency'] = data.costCurrency!;
if (data.fbInstallReferrer != null) attribution['fbInstallReferrer'] = data.fbInstallReferrer!;
try {
await Adapty().updateAttribution(attribution, source: AdaptyAttributionSource.adjust);
} on AdaptyError catch (adaptyError) {
// handle error
} catch (e) {}
};
import { Adjust, AdjustConfig } from "react-native-adjust";
import { adapty } from "react-native-adapty";
var adjustConfig = new AdjustConfig(appToken, environment);
// Before submiting Adjust config...
adjustConfig.setAttributionCallbackListener(attribution => {
// Make sure Adapty SDK is activated at this point
// You may want to lock this thread awaiting of `activate`
adapty.updateAttribution(attribution, "adjust");
});
// ...
Adjust.create(adjustConfig);
AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironment.Sandbox);
adjustConfig.setAttributionChangedDelegate(this.attributionChangedDelegate);
public void attributionChangedDelegate(AdjustAttribution attribution) {
Dictionary<String, object> data = new Dictionary<String, object>();
if (attribution.adid != null) data["adid"] = attribution.adid;
if (attribution.network != null) data["network"] = attribution.network;
if (attribution.campaign != null) data["campaign"] = attribution.campaign;
if (attribution.adgroup != null) data["adgroup"] = attribution.adgroup;
if (attribution.creative != null) data["creative"] = attribution.creative;
String attributionString = JsonUtility.ToJson(data);
Adapty.UpdateAttribution(attributionString, AttributionSource.Adjust, (error) => {
// handle the error
});
}
Updated 20 days ago