Developers » AS2 tagging » Apple » Advanced features » Tracker Delegate
Tracker Delegate
- iOS
- watchOS
- tvOS
Foreword
The instance of a tracker is accompanied by a delegate enabling you to track the tagging of your application. It is therefore easier to detect a problem or execute custom processes.
Use
Once your tag is initialised, you must assign the delegate property of the tracker to the instance of the class which implements the protocol methods of the TrackerDelegate. We also have a default class that implement the protocol named DefaultTrackerDelegate.
In the case of a Swift project, make sure to import the Tracker module (or tvOSTracker/watchOSTracker if your target is an Apple TV or an Apple Watch) in your View Controller. In the case of an Objective-C project, make sure to import the headers Tracker-Swift.h
let defaultDelegate: DefaultTrackerDelegate = DefaultTrackerDelegate() override func viewDidLoad() { super.viewDidLoad() let tracker = ATInternet.sharedInstance.defaultTracker tracker.delegate = defaultDelegate }
self.defaultTrackerDelegate = [[DefaultTrackerDelegate alloc] init]; self.tracker.delegate = self.defaultTrackerDelegate;
TrackerDelegate Protocol
Optionnal Methods
Name | Return type | Settings | Description |
---|---|---|---|
trackerNeedsFirstLaunchApproval | void | message | Event triggered when the tracker was first initialised. |
buildDidEnd | void | status, message | Event triggered at the end of construction of a hit |
sendDidEnd | void | status, message | Event triggered at the end of sending a hit |
saveDidEnd | void | message | Event triggered when saving a hit |
didCallPartner | void | response | Event triggered once the partner’s response was received |
warningDidOccur | void | message | Event triggered when a tagging problem occurred (non-blocking for sending the hit) |
errorDidOccur | void | message | Event triggered when a tagging problem occurred (blocked the hit from sending) |