adjust-icon

Set up an attribution callback

When Adjust receives install data from the Adjust iOS Extension for Adobe Experience SDK, the device is attributed to the source of the install. This attribution information can change if the user is retargeted or interacts with another campaign.

You can configure a callback function to respond to attribution changes. When Adjust receives new attribution information, it sends the data asynchronously back to the device. The callback function receives the device's attribution data as an argument.

Read Adjust's attribution data policies for more information about attribution data.

Reference

To set a callback function to listen for attribution changes, call the setAttributionChangedBlock method of your AdjustAdobeExtensionConfig instance with the following argument:

attributionChangedBlock: OnAttributionChangedListener

A function that returnsvoidand receives device attribution information as a serialized attribution object.

Tutorial: Create an attribution callback

To configure an attribution callback, you need to create a function and assign it to your AdjustAdobeExtensionConfig instance. In this tutorial, you'll build on the App Delegate from the integration guide and create a completion function that outputs the user's attribution information to logs as a string. The final result looks like this:

Here's what you need to do:

  1. Inside your App Delegate, find your AdjustAdobeExtensionConfig instantiation. On the next line, call the setAttributionChangedBlock method with a function block as an argument. This function block receives the attribution information.

  2. Inside the function block, output the attribution description to the Xcode logger.

That's it! When a user's attribution information changes, this callback function writes out the updated attribution information to the system log.