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
costTypestringThe campaign pricing model (for example cpi)
costAmountdoubleThe cost of the install.
costCurrencystringThe 3 character ISO 4217 code of the currency associated with the cost.
fbInstallReferrerstringThe Facebook install referrer. Android only.

Trigger a function when attribution changes

Property declaration
public Action<AdjustAttribution> AttributionChangedDelegate { get; set; }

The SDK can listen for attribution changes and call a function when it detects an update. To configure your callback function, assign a function to the AttributionChangedDelegate of your AdjustConfig instance.

using com.adjust.sdk;
public class ExampleGUI : MonoBehaviour {
void OnGUI() {
if (GUI.Button(new Rect(0, 0, Screen.width, Screen.height), "callback")) {
AdjustConfig adjustConfig = new AdjustConfig("{Your App Token}", AdjustEnvironmentSandbox);
adjustConfig.LogLevel = AdjustLogLevel.Verbose;
adjustConfig.AttributionChangedDelegate = this.AttributionChangedDelegate;
Adjust.InitSdk(adjustConfig);
}
}
public void AttributionChangedDelegate(AdjustAttribution attribution) {
Debug.Log("Attribution changed");
// ...
}
}

Get current attribution information

Method signature
public static void GetAttribution(Action<AdjustAttribution> callback)

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 Adjust.GetAttribution method and pass a callback function. The SDK fetches the attribution information asynchronously and passes it to your completion handler as an AdjustAttribution object.

Adjust.GetAttribution(attribution =>
{
// use attribution
});