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.

Trigger a function when attribution changes

Method signature
public void setAttributionChangedDelegate(Action<AdjustAttribution> attributionChangedDelegate, string sceneName = "Adjust");

The SDK can listen for attribution changes and call a function when it detects an update. To configure your callback function, call the setAttributionChangedDelegate method with your function name as an argument.

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.setLogLevel(AdjustLogLevel.Verbose);
adjustConfig.setAttributionChangedDelegate(this.attributionChangedDelegate);
Adjust.start(adjustConfig);
}
}
public void attributionChangedDelegate(AdjustAttribution attribution) {
Debug.Log("Attribution changed");
// ...
}
}

Get current attribution information

Method signature
public static AdjustAttribution getAttribution();

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.

var attribution = Adjust.getAttribution();