adjust-icon

Get attribution information

When a user interacts with an Adjust link, their attribution information updates. This can happen if the user interacts with a deep link. Information about a user's attribution is represented in the AdjustAttribution2dx class.

AdjustAttribution2dx class properties

The AdjustAttribution2dx class contains details about the current attribution status of the device. Any values that aren't populated for the user are returned as a std::string value.

ValuesData typeDescription
trackerTokenstd::stringThe token of the tracker to which the device is currently attributed
trackerNamestd::stringThe name of the tracker to which the device is currently attributed
networkstd::stringThe name of the network to which the device is currently attributed
campaignstd::stringThe name of the campaign to which the device is currently attributed
adgroupstd::stringThe name of the adgroup to which the device is currently attributed
creativestd::stringThe name of the creative to which the device is currently attributed
clickLabelstd::stringThe click label that the install is tagged with
costTypestd::stringThe campaign pricing model (for example cpi)
costAmountdoubleThe cost of the install.
costCurrencystd::stringThe 3 character ISO 4217 code of the currency associated with the cost.
fbInstallReferrerstd::stringThe Facebook install referrer.

Configure an attribution callback function

You can configure the Adjust SDK to call a function whenever a user's attribution information updates by passing the function to the setAttributionCallback method on your AdjustConfig2dx instance. The SDK calls this function with an AdjustAttribution2dx object as its argument.

AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);
adjustConfig.setLogLevel(AdjustLogLevel2dxVerbose);
adjustConfig.setAttributionCallback([](AdjustAttribution2dx attribution) {
// process attribution
});
Adjust2dx::initSdk(adjustConfig);

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 as an AdjustAttribution2dx object, call the Adjust2dx::getAttribution method.

Adjust2dx::getAttribution([](AdjustAttribution2dx attribution) {
// process attribution
});