Get attribution information

When a user interacts with a campaign link, their attribution information updates. This can happen if the user interacts with a deep link. 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.

Important:
You must call the attributionChangedDelegate method before initializing the Adjust SDK in your app.
C#
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}", AdjustEnvironment.Sandbox);
            adjustConfig.setLogLevel(AdjustLogLevel.Verbose);
            adjustConfig.setAttributionChangedDelegate(this.attributionChangedDelegate);
            Adjust.start(adjustConfig);
        }
    }

    public void attributionChangedDelegate(AdjustAttribution attribution) {
        Debug.Log("Attribution changed");
        // ...
    }
}

Within your delegate function, you have access to the user's Attribution object. See the Attribution class reference for a list of available parameters.

Get current attribution information

Note:
This method is available in Adjust SDK v4.11.0 and later.

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.

This method returns an Attribution object. See the Attribution class reference for a list of available parameters.

C#
var attribution = Adjust.getAttribution();