Adjust
Adjust is one of the leading Mobile Measurement Partner (MMP) platforms, that collects and presents data from marketing campaigns. This helps companies track their campaign performance.
Adapty provides a complete set of data that lets you track subscription events from stores in one place. With Adapty, you can easily see how your subscribers are behaving, learn what they like, and use that information to communicate with them in a way that's targeted and effective. Therefore, this integration allows you to track subscription events in Adjust and analyze precisely how much revenue your campaigns generate.
The integration between Adapty and Adjust works in two main ways.
- Receiving attribution data from Adjust
Once you've set up the Adjust integration, Adapty will start receiving attribution data from Adjust. You can easily access and view this data on the user's profile page.
- Sending subscription events to Adjust
Adapty can send all subscription events which are configured in your integration to Adjust. As a result, you'll be able to track these events within the Adjust dashboard. This integration is beneficial for evaluating the effectiveness of your advertising campaigns.
How to set up Adjust integration
To setup the integration with Adjust go to Integrations > Adjust in the Adapty Dashboard, turn on a toggle from off to on, and fill out fields.
The next step of the integration is to set credentials.
- If you have enabled OAuth authorization on the Adjust platform, it is mandatory to provide an **OAuth Token **during the integration process for your iOS and Android apps.
- Next, you need to provide the app tokens for your iOS and Android apps. 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
You will need to copy App Token and paste it to Adapty.
Another important thing is that Adjust doesn't support events older than 58 days. So, if you have an event that is more than 58 days old, Adapty will send it to Adjust, but the event datetime will be replaced by the current timestamp.
Events and tags
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.
So first step here is to find event tokens for all events that you want Adapty to send. To do that go to All Settings in your Adjust dashboard.
Copy the event token and paste it to Adapty. Below the credentials, there are three groups of events you can send to Adjsut from Adapty. Check the full list of the events offered by Adapty here.
Adapty will send subscription events to Adjust using a server-to-server integration, allowing you to view all subscription events in your Adjust dashboard and link them to your acquisition campaigns.
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.
- Adjust 5.x+
- Adjust 4.x
For Adjust version 5.0 or later, use the following:
- iOS (Swift)
- Android (Kotlin)
- Android (Java)
- Flutter
- Unity (C#)
- React Native (TS)
Adjust.attribution { attribution in
guard let attributionDictionary = attribution?.dictionary() else { return }
Adjust.adid { adid in
guard let adid else { return }
Adapty.updateAttribution(attributionDictionary, source: .adjust, networkUserId: adid) { error in
// handle the error
}
}
}
Adjust.getAttribution { attribution ->
if (attribution == null) return@getAttribution
Adjust.getAdid { adid ->
if (adid == null) return@getAdid
Adapty.updateAttribution(attribution, AdaptyAttributionSource.ADJUST, adid) { error ->
// handle the error
}
}
}
Adjust.getAttribution(attribution -> {
if (attribution == null) return;
Adjust.getAdid(adid -> {
if (adid == null) return;
Adapty.updateAttribution(attribution, AdaptyAttributionSource.ADJUST, adid, error -> {
// handle the error
});
});
});
import 'package:adjust_sdk/adjust.dart';
import 'package:adjust_sdk/adjust_config.dart';
try {
final adid = await Adjust.getAdid();
if (adid == null) {
// handle the error
}
final attributionData = await Adjust.getAttribution();
var attribution = Map<String, String>();
if (attributionData.trackerToken != null) attribution['trackerToken'] = attributionData.trackerToken!;
if (attributionData.trackerName != null) attribution['trackerName'] = attributionData.trackerName!;
if (attributionData.network != null) attribution['network'] = attributionData.network!;
if (attributionData.adgroup != null) attribution['adgroup'] = attributionData.adgroup!;
if (attributionData.creative != null) attribution['creative'] = attributionData.creative!;
if (attributionData.clickLabel != null) attribution['clickLabel'] = attributionData.clickLabel!;
if (attributionData.costType != null) attribution['costType'] = attributionData.costType!;
if (attributionData.costAmount != null) attribution['costAmount'] = attributionData.costAmount!.toString();
if (attributionData.costCurrency != null) attribution['costCurrency'] = attributionData.costCurrency!;
if (attributionData.fbInstallReferrer != null) attribution['fbInstallReferrer'] = attributionData.fbInstallReferrer!;
Adapty().updateAttribution(
attribution,
source: AdaptyAttributionSource.adjust,
networkUserId: adid,
);
} catch (e) {
// handle the error
}
using static AdaptySDK.Adapty;
using AdjustSdk;
Adjust.GetAdid((adid) => {
Adjust.GetAttribution((attribution) => {
Dictionary<String, object> data = new Dictionary<String, object>();
data["network"] = attribution.Network;
data["campaign"] = attribution.Campaign;
data["adgroup"] = attribution.Adgroup;
data["creative"] = attribution.Creative;
String attributionString = JsonUtility.ToJson(data);
Adapty.UpdateAttribution(attributionString, AttributionSource.Adjust, adid, (error) => {
// handle the error
});
});
});
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);
For Adjust version 4.x or earlier, use the following:
- iOS (Swift)
- Android (Kotlin)
- Flutter
- Unity (C#)
- React Native (TS)
// 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) {}
};
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
});
}
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);