Skip to content

Attribution Callback

Obaied edited this page Nov 2, 2016 · 2 revisions

You can register a listener to be notified of tracker attribution changes. Due to the different sources considered for attribution, this information cannot by provided synchronously. The simplest way is to create a single anonymous listener which is going to be called each time your user's attribution value changes:

With the AdjustConfig instance, before starting the SDK, add the anonymous listener:

var adjustConfig = new AdjustConfig(appToken, environment);

adjustConfig.setAttributionCallbackListener(function(attribution) {
    // Printing all attribution properties.
    console.log("Attribution changed!");
    console.log(attribution.trackerToken);
    console.log(attribution.trackerName);
    console.log(attribution.network);
    console.log(attribution.campaign);
    console.log(attribution.adgroup);
    console.log(attribution.creative);
    console.log(attribution.clickLabel);
});

Adjust.create(adjustConfig);

Within the listener function you have access to the attribution parameters. Here is a quick summary of its properties:

  • trackerToken the tracker token of the current install.
  • trackerName the tracker name of the current install.
  • network the network grouping level of the current install.
  • campaign the campaign grouping level of the current install.
  • adgroup the ad group grouping level of the current install.
  • creative the creative grouping level of the current install.
  • clickLabel the click label of the current install.

Please make sure to consider our applicable attribution data policies.

Clone this wiki locally