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.

Dart
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);

This method returns an 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 Adjust tracks an app install and an attribution callback has been already triggered.
Dart
AdjustAttribution attribution = Adjust.getAttribution();

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