All other events except the standard events such as “switch”, “SeekBar” and etc can be tracked using the “trackCustom” method.

Method

@objc public func trackCustom(viewName: String = "", action: [String : Any], controller: UIViewController, addGeo: Bool)

Parameters

viewName	  - The custom event name
action	    - The json object which contains the tracking information about the custom event.
controller	- The current view.
addGeo	    - Flag used to decide whether to append the geo parameter(latitude and longitude) in the Payloads or Not.

Example

Tracker.shared.trackCustom(viewName: "trackingSwitch",
                               action: ["name" : "UISwitch", "value" : sender.isOn ? "ON" : "OFF",],
                               controller: self,
                               addGeo: sender.isOn)