When Adjust receives install data from the Adjust Android 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.
To set a callback function to listen for attribution changes, call the setOnAttributionChangedListener method of your AdjustAdobeExtensionConfig instance with the following argument:
A function that returnsvoidand receives device attribution information as a serialized JSON 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 MainApp.java from the integration guide and add an onAttributionChanged callback 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:
Inside the try...catch block, call the setOnAttributionChangedListener method of your AdjustAdobeExtensionConfig instance. Pass an OnAttributionChangedListener instance as an argument.
Create a new public function called onAttributionChanged inside your setOnAttributionChangedListener declaration. This method takes an AdjustAttribution argument and returns void.
Inside the onAttributionChanged function body, log the AdjustAttribution object by converting it to a string.
That's it! When a user's attribution information changes, this callback function writes out the updated attribution information to the system log.