Analytics-iAds-Attribution 3.1.0

Analytics-iAds-Attribution 3.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jan 2021

Maintained by Prateek Srivastava, Ladan Azita Nasserian, Segment, Brennan Gamwell.



Analytics-iAds-Attribution

Version License Platform

Records iAd attribution information using analytics-ios.

When it is able to retrieve iAd information, it will augment all track events. The attribution information is transformed to Segment context this way:

[analytics track:@"Application Installed",
    @"context" : @{
      @"campaign" : @{
        @"provider" : @"Apple",
        @"click_date" : attributionInfo[@"iad-click-date"],
        @"conversion_date" : attributionInfo[@"iad-conversion-date"],
        @"source" : @"iAd",
        @"name" : attributionInfo[@"iad-campaign-name"],
        @"content" : attributionInfo[@"iad-keyword"],
        @"ad_creative" : attributionInfo[@"iad-org-name"],
        @"ad_group" : attributionInfo[@"iad-adgroup-name"],
        @"id" : attributionInfo[@"iad-campaign-id"],
        @"ad_group_id" : attributionInfo[@"iad-adgroup-id"]
      }    
    }
}];

Because this information in passed through the context object, this will not be received by other downstream integrations, unless explicitly mapped. Kochava is currently the only integration which supports Apple Search Ads.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Analytics-iAds-Attribution is available through CocoaPods. This pod requires version 3.6.0 or higher of the Analytics pod. To install it, simply add the following line to your Podfile:

pod "Analytics"
pod "Analytics-iAds-Attribution"
#import <Analytics-iAds-Attribution/SEGADTracker.h>

// Initialize the configuration as you would normally.
SEGAnalyticsConfiguration *configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"];
...

// Configure the client with the iAD middleware to attach iAd properties.
configuration.sourceMiddleware = @[ [SEGADTracker middleware] ];

[SEGAnalytics setupWithConfiguration:configuration];

Author

Segment.io, Inc., [email protected]

License

Analytics-iAds-Attribution is available under the MIT license. See the LICENSE file for more info.