adjust-icon

Get attribution information

When a user interacts with an Adjust link, their attribution information updates. This can happen if the user interacts with a deep link. Information about a user’s attribution is represented in the AdjustAttribution class.

AdjustAttribution class properties

The AdjustAttribution class contains details about the current attribution status of the device. Any values that aren’t populated for the user are returned as a null value.

ValuesData typeDescription
trackerTokenStringThe token of the link to which the device is currently attributed
trackerNameStringThe name of the link to which the device is currently attributed
networkStringThe name of the network to which the device is currently attributed
campaignStringThe name of the campaign to which the device is currently attributed
adgroupStringThe name of the adgroup to which the device is currently attributed
creativeStringThe name of the creative to which the device is currently attributed
clickLabelStringThe click label that the install is tagged with
adidStringThe unique Adjust ID assigned to the device
costTypeStringThe campaign pricing model (for example cpi)
costAmountnumThe cost of the install.
costCurrencyStringThe 3 character ISO 4217 code of the currency associated with the cost.
fbInstallReferrerStringThe Facebook install referrer.

Trigger a function when attribution changes

Property declaration
typedef void AttributionCallback(AdjustAttribution attributionData);
AttributionCallback? attributionCallback;

The SDK can listen for attribution changes and call a function when it detects an update. To configure your callback function, assign your function to the attributionCallback property on your config instance.

AdjustConfig adjustConfig = new AdjustConfig(yourAppToken, environment);
config.attributionCallback = (AdjustAttribution attributionChangedData) {
print('[Adjust]: Attribution changed!');
if (attributionChangedData.trackerToken != null) {
print('[Adjust]: Tracker token: ' + attributionChangedData.trackerToken);
}
if (attributionChangedData.trackerName != null) {
print('[Adjust]: Tracker name: ' + attributionChangedData.trackerName);
}
if (attributionChangedData.campaign != null) {
print('[Adjust]: Campaign: ' + attributionChangedData.campaign);
}
if (attributionChangedData.network != null) {
print('[Adjust]: Network: ' + attributionChangedData.network);
}
if (attributionChangedData.creative != null) {
print('[Adjust]: Creative: ' + attributionChangedData.creative);
}
if (attributionChangedData.adgroup != null) {
print('[Adjust]: Adgroup: ' + attributionChangedData.adgroup);
}
if (attributionChangedData.clickLabel != null) {
print('[Adjust]: Click label: ' + attributionChangedData.clickLabel);
}
if (attributionChangedData.adid != null) {
print('[Adjust]: Adid: ' + attributionChangedData.adid);
}
};
Adjust.start(adjustConfig);

Get current attribution information

Method signature
static Future<AdjustAttribution> getAttribution() async

When a user installs your app, Adjust attributes the install to a campaign. The Adjust SDK gives you access to campaign attribution details for your install. To return this information, call the getAttribution method to return the attribution information as an AdjustAttribution object.

AdjustAttribution attribution = Adjust.getAttribution();