Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 1.39 KB

Integrate Adjust with the SDK

To integrate Adjust with SDK, you must send your Adjust attribution data to the Batch SDK after receiving the attribution response from our backend. Follow the steps in the attribution callback chapter of our iOS SDK guide to implement this. To use the SDK API, the callback method can be set as the following:

- (void)adjustAttributionChanged:(ADJAttribution *)attribution {
    // initiate Batch user editor to set new attributes
    BatchUserDataEditor *editor = [BatchUser editor];

    if ( != nil)
        [editor forKey:@"adjust_network"];
    if (attribution.campaign != nil)
        [editor setAttribute:attribution.campaign forKey:@"adjust_campaign"];
    if (attribution.adgroup != nil)
        [editor setAttribute:attribution.adgroup forKey:@"adjust_adgroup"];
    if (attribution.creative != nil)
        [editor setAttribute:attribution.creative forKey:@"adjust_creative"];

    // send new attributes to Batch servers
    [editor save];

Before you implement this interface, please take care to consider the possible conditions for usage of some of your data.