Tracker

public class Tracker: NSObject

Wrapper class for tracking usage of your application

  • Tracker current delegate

    Declaration

    Swift

    public var delegate: TrackerDelegate?
  • Sets Tracker in debug mode and display debugger window

    Declaration

    Swift

    public var enableDebugger: Bool = false
  • Return Offline instance

    Declaration

    Swift

    fileprivate(set) public lazy var offline: Offline = Offline(tracker: self)
  • Return Context instance

    Declaration

    Swift

    fileprivate(set) public lazy var context: Context = Context(tracker: self)
  • Return NuggAd instance

    Declaration

    Swift

    fileprivate(set) public lazy var nuggAds: NuggAds = NuggAds(tracker: self)
  • Return GPS tracking instance - Deprecated : location is now only available as a screen object property.

    Declaration

    Swift

    fileprivate(set) public lazy var locations: Locations = Locations(tracker: self)
  • Get Screens instances

    Declaration

    Swift

    fileprivate(set) public lazy var screens: Screens = Screens(tracker: self)
  • Return gestures instance

    Declaration

    Swift

    fileprivate(set) public lazy var gestures: Gestures = Gestures(tracker: self)
  • Return CustomVar instance - Deprecated : customVars is now only available as a screen object property.

    Declaration

    Swift

    fileprivate(set) public lazy var customVars: CustomVars = CustomVars(tracker: self)
  • Return Order instance

    Declaration

    Swift

    fileprivate(set) public lazy var orders: Orders = Orders(tracker: self)
  • Return Aisle instance - Deprecated : aisles is now only available as a screen object property.

    Declaration

    Swift

    fileprivate(set) public lazy var aisles: Aisles = Aisles(tracker: self)
  • Return Cart instance

    Declaration

    Swift

    fileprivate(set) public lazy var cart: Cart = Cart(tracker: self)
  • Return Products instance

    Declaration

    Swift

    fileprivate(set) public lazy var products: Products = Products(tracker: self)
  • Campaign Tracking. Campaign is now available as a screen object property but you may use this method for notification tracking

    Declaration

    Swift

    fileprivate(set) public lazy var campaigns: Campaigns = Campaigns(tracker: self)
  • Return InternalSearch instance - Deprecated : internalSearch is now only available as a screen object property.

    Declaration

    Swift

    fileprivate(set) public lazy var internalSearches: InternalSearches = InternalSearches(tracker: self)
  • Initialisation with default configuration

    Declaration

    Swift

    public convenience override init()
  • Initialisation with a custom configuration

    Declaration

    Swift

    public init(configuration: [String: String])

    Parameters

    configuration

    map that contains key/values. See TrackerConfigurationKeys

  • Get the current configuration (read-only)

    Declaration

    Swift

    public var config: [String:String]
  • Set a new configuration

    Declaration

    Swift

    public func setConfig(_ configuration: [String: String], override: Bool = false, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    configuration

    A dictionary that contains new key/values. see TrackerConfigurationKeys.

    override

    if true: the old configuration is full cleared - all default keys be set (optional, default: false)

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set one new key/value pair

    Declaration

    Swift

    public func setConfig(_ key: String, value: String, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    key

    see TrackerConfigurationKeys

    value

    /

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new log

    Declaration

    Swift

    public func setLog(_ log: String, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    log

    ATInternet subdomain value

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new secure log

    Declaration

    Swift

    public func setSecuredLog(_ securedLog: String, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    securedLog

    ATInternet secured subdomain value

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new domain

    Declaration

    Swift

    public func setDomain(_ domain: String, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    domain

    ATInternet collect domain value

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new site ID

    Declaration

    Swift

    public func setSiteId(_ siteId: Int, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    siteId

    ATInternet site identifier

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set the offline mode

    Declaration

    Swift

    public func setOfflineMode(_ offlineMode: OfflineModeKey, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    offlineMode

    (required, always, never)

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Enable the secure mode (use HTTPS with secured log)

    Declaration

    Swift

    public func setSecureModeEnabled(_ enabled: Bool, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    enabled

    /

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new identifier type

    Declaration

    Swift

    public func setIdentifierType(_ identifierType: IdentifierTypeKey, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    identifierType

    IdentifierTypeKey

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Enable hash user id (SHA-256 with salt to ensure anonymity)

    Declaration

    Swift

    public func setHashUserIdEnabled(_ enabled: Bool, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    enabled

    /

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new Plugin

    Declaration

    Swift

    public func setPlugins(_ pluginNames: [PluginKey], sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    pluginNames

    list of PluginKey

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Enable background task

    Declaration

    Swift

    public func setBackgroundTaskEnabled(_ enabled: Bool, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    enabled

    /

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set new pixel path

    Declaration

    Swift

    public func setPixelPath(_ pixelPath: String, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    pixelPath

    request path to get pixel

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Enable persistent identified visitor (identification data available for all sessions)

    Declaration

    Swift

    public func setPersistentIdentifiedVisitorEnabled(_ enabled: Bool, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    enabled

    /

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new TvTracker URL

    Declaration

    Swift

    public func setTvTrackingUrl(_ url: String, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    url

    TVTTracking campaign url

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set duration of the visit duration

    Declaration

    Swift

    public func setTvTrackingVisitDuration(_ visitDuration: Int, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    visitDuration

    duration of the visit

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new TVTTracking spot validity time

    Declaration

    Swift

    public func setTvTrackingSpotValidityTime(_ time: Int, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    time

    time during which campaign is valid

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Enable the campaign persistance

    Declaration

    Swift

    public func setCampaignLastPersistenceEnabled(_ enabled: Bool, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    enabled

    store last or first campaign

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new campaign lifetime

    Declaration

    Swift

    public func setCampaignLifetime(_ lifetime: Int, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    lifetime

    campaign lifetime

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Set a new Session duration

    Declaration

    Swift

    public func setSessionBackgroundDuration(_ duration: Int, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)

    Parameters

    duration

    Duration between two application openings after which a new session is started

    sync

    perform the operation synchronously (optional, default: false)

    completionHandler

    called when the operation has been done

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: @escaping ()->(String)) -> Tracker

    Parameters

    key

    parameter key

    value

    string parameter value

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: @escaping ()->(String), options: ParamOption) -> Tracker

    Parameters

    key

    parameter key

    value

    string parameter value

    options

    parameter options

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: String) -> Tracker

    Parameters

    key

    parameter key

    value

    string parameter value

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: String, options: ParamOption) -> Tracker

    Parameters

    key

    parameter key

    value

    string parameter value

    options

    parameter options

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: Int) -> Tracker

    Parameters

    key

    parameter key

    value

    int parameter value

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: Int, options: ParamOption) -> Tracker

    Parameters

    key

    parameter key

    value

    int parameter value

    options

    parameter options

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: Float) -> Tracker

    Parameters

    key

    parameter key

    value

    float parameter value

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: Float, options: ParamOption) -> Tracker

    Parameters

    key

    parameter key

    value

    float parameter value

    options

    parameter options

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: Double) -> Tracker

    Parameters

    key

    parameter key

    value

    double parameter value

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: Double, options: ParamOption) -> Tracker

    Parameters

    key

    parameter key

    value

    double parameter value

    options

    parameter options

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: Bool) -> Tracker

    Parameters

    key

    parameter key

    value

    bool parameter value

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: Bool, options: ParamOption) -> Tracker

    Parameters

    key

    parameter key

    value

    bool parameter value

    options

    parameter options

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: [Any]) -> Tracker

    Parameters

    key

    parameter key

    value

    array parameter value

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: [Any], options: ParamOption) -> Tracker

    Parameters

    key

    parameter key

    value

    array parameter value

    options

    parameter options

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: [String: Any]) -> Tracker

    Parameters

    key

    parameter key

    value

    dictionary parameter value

    Return Value

    the current tracker

  • Add a parameter in the hit querystring

    Declaration

    Swift

    public func setParam(_ key: String, value: [String: Any], options: ParamOption) -> Tracker

    Parameters

    key

    parameter key

    value

    dictionary parameter value

    options

    parameter options

    Return Value

    the current tracker

  • Remove a parameter from the hit querystring

    Declaration

    Swift

    public func unsetParam(_ param: String)

    Parameters

    param

    type

  • Remove the screen context: Use only for specific issue mark screenA, mark touchA, dont mark screenB, mark touchB. touchB will be no longer attached to screenA

    Declaration

    Swift

    public func resetScreenContext()
  • Sends all tracking objects added

    Declaration

    Swift

    public func dispatch()
  • Get the user id

    Declaration

    Swift

    public func getUserId() -> String

    Return Value

    the user id depending on configuration (uuid, idfv)

  • Set a custom user id

    Declaration

    Swift

    public func setUserId(userId: String)

    Parameters

    userId

    the userID. if hashUserId is enabled, the hash will be performed on this userID

  • Disable user identification.

    Declaration

    Swift

    public class var doNotTrack: Bool
  • Set tracker crash handler Use only if you don’t already use another crash analytics solution Once enabled, tracker crash handler can’t be disabled until tracker instance termination

    Declaration

    Swift

    public class var handleCrash: Bool