Get attribution information

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

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 setAttributionCallbackListener with your function name as an argument.

Javascript
var adjustConfig = new AdjustConfig(appToken, environment);

adjustConfig.setAttributionCallbackListener(function() {
    // Printing all attribution properties.
    console.log("Attribution property");
});

Adjust.create(adjustConfig);

Within your listener 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

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.

Note:
You can get information about current attribution only after Ajust tracks an app install and an attribution callback has been already triggered.
Javascript
AdjustAttribution attribution = Adjust.getAttribution();

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