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

NameReturn typeSettingsDescription
trackerNeedsFirstLaunchApprovalvoidmessageEvent triggered when the tracker was first initialised.
buildDidEndvoidstatus, messageEvent triggered at the end of construction of a hit
sendDidEndvoidstatus, messageEvent triggered at the end of sending a hit
saveDidEndvoidmessageEvent triggered when saving a hit
didCallPartnervoidresponseEvent triggered once the partner’s response was received
warningDidOccurvoidmessageEvent triggered when a tagging problem occurred (non-blocking for sending the hit)
errorDidOccurvoidmessageEvent triggered when a tagging problem occurred (blocked the hit from sending)
Last update: 22/07/2019