Almost every iOS app other than very small hobby projects have a tracker architecture to measure and track analytic events. Sometimes its enough to implement either third party solution or in-house tracking solution, sometimes you should support both of these. Besides just implementing them, for the sake of the project, you want to keep tracking mechanism tidy too.

Since Trendyol iOS app is one of the most popular iOS apps in Turkey at the e-commerce category, we use both varieties of third party solutions and an in-house solution too for event tracking. Actually we had a tracking mechanism which has been performing well until the last quarter, however we have noticed that it won’t scale enough and comes with some problems as app grows. First take a look at the previous tracking solution we want to change, to see what are the problems here.

Let’s start with Tracking Service;

typealias TrackingParams = [String: Any]?

	enum TrackingService {
	    case awesomeTracking(params: TrackingParams)
	    case firebase(name: String, params: TrackingParams)
	    case adjust(event: ADJEvent?)
	    case facebook(facebookEvents: FacebookEvents)
	}

TrackingService is a basic enum that contains tracking options. As you can see, it consists of some of the popular third party solutions and one in-house solution named AwesomeTracking.

#ios #events #tracker #swift #modular

Modular Event Tracker in Swift
2.60 GEEK