Bài viết liên tục được cập nhật, và những phần được cập nhật rất có thể chưa được dịch sang ngôn ngữ của bạn. Để xem thông tin mới nhất, vui lòng chọn ngôn ngữ Tiếng Anh.

Attribution callbacks

You can register a delegate callback to notify you of tracker attribution changes. The Adjust SDK cannot provide this information synchronously. This is due to the different sources considered for attribution.

Follow the steps in this article to implement the optional delegate protocol in your app.

Quan trọng:
To set up the delegate callback, you need to configure it in your ADJConfig instance. This means you will need to add the setDelegate call before you call the appDidLaunch method.
  1. If you are not using web views, add the AdjustDelegate declaration to your AppDelegate header file.
Objective-C
Swift

In your AppDelegate.h file:

@interface AppDelegate : UIResponder <UIApplicationDelegate, AdjustDelegate>
  1. If you are not using web views, add the delegate callback function to your app delegate implementation.
Objective-C
Swift

In your AppDelegate.m file:

- (void)adjustAttributionChanged:(ADJAttribution *)attribution {
}
  1. Set the delegate with your Adjust config instance.
Objective-C
Swift
Javascript
[adjustConfig setDelegate:self];

The SDK will call the delegate function after receiving its final attribution data. Within the delegate function, you will have access to the attribution object.

All properties are returned as a JSON object. Any values that are not populated will be sent back as nil.

Lưu ý:
Cost data ( costType, costAmount , and costCurrency) are only available when the needsCost property on the config object is set to true.
Giá trịLoại dữ liệuMô tả
token trình theo dõiChuỗiThe token of the tracker to which the device is currently attributed.
TrackerNameChuỗiThe name of the tracker to which the device is currently attributed.
networkChuỗiThe name of the network to which the device is currently attributed.
campaignChuỗiThe name of the campaign to which the device is currently attributed.
adgroupChuỗiThe name of the adgroup to which the device is currently attributed.
creativeChuỗiThe name of the creative to which the device is currently attributed.
clickLabelChuỗiThe click label that the install is tagged with.
adidChuỗiThe unique Adjust ID assigned to the device.
costTypeChuỗiThe campaign pricing model (e.g. cpi).
costAmountSốThe cost of the install.
costCurrencyChuỗiThe code of the currency associated with the cost. This should be a three character string that follows the ISO 4217 standard

User attribution

You can call the attribution method to get the user's current attribution. This will return all the information found in the ADJAttribution class as a JSON object.

Lưu ý:
Information about current attribution is available after the backend has tracked the installation. The attribution callback will fetch this information for you to use.
Objective-C
Swift
Javascript
ADJAttribution *attribution = [Adjust attribution];