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.
To run the example project, clone the repo, and run pod install
from the Example directory first.
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];
Segment.io, Inc., [email protected]
Analytics-iAds-Attribution is available under the MIT license. See the LICENSE file for more info.