Tracker
public class Tracker : NSObject
Wrapper class for tracking usage of your application
-
Tracker current delegate
Declaration
Swift
@objc public var delegate: TrackerDelegate? { get set }
-
Sets Tracker in debug mode and display debugger window
Declaration
Swift
@objc public var enableDebugger: Bool { get set }
-
Return Offline instance
Declaration
Swift
@objc fileprivate(set) public lazy var offline: Offline { get set }
-
Return Context instance
Declaration
Swift
@objc fileprivate(set) public lazy var context: Context { get set }
-
Return NuggAd instance
Declaration
Swift
@objc fileprivate(set) public lazy var nuggAds: NuggAds { get set }
-
Return GPS tracking instance
- Deprecated : location is now only available as a screen object property.
Declaration
Swift
@available(*, deprecated, message: "location is now only available as a screen object property (> 2.5.0﹚.") @objc fileprivate(set) public lazy var locations: Locations { get set }
-
Return Publisher instance
Declaration
Swift
@objc fileprivate(set) public lazy var publishers: Publishers { get set }
-
Return SelfPromotions instance
Declaration
Swift
@objc fileprivate(set) public lazy var selfPromotions: SelfPromotions { get set }
-
Return Identified visitor instance
Declaration
Swift
@objc fileprivate(set) public lazy var identifiedVisitor: IdentifiedVisitor { get set }
-
Get Screens instances
Declaration
Swift
@objc fileprivate(set) public lazy var screens: Screens { get set }
-
Dynamic Screen tracking
Declaration
Swift
@objc fileprivate(set) public lazy var dynamicScreens: DynamicScreens { get set }
-
Return gestures instance
Declaration
Swift
@objc fileprivate(set) public lazy var gestures: Gestures { get set }
-
Return CustomObjects instance
Declaration
Swift
@objc fileprivate(set) public lazy var customObjects: CustomObjects { get set }
-
Return ECommerce instance
Declaration
Swift
@objc fileprivate(set) public lazy var ecommerce: ECommerce { get set }
-
Return AVInsights instance
Declaration
Swift
@objc fileprivate(set) public lazy var avInsights: AVInsights { get set }
-
Return Events instance
Declaration
Swift
@objc fileprivate(set) public lazy var events: Events { get set }
-
Return CustomVar instance
- Deprecated : customVars is now only available as a screen object property.
Declaration
Swift
@available(*, deprecated, message: "customVars is now only available as a screen object property (> 2.5.0﹚.") @objc fileprivate(set) public lazy var customVars: CustomVars { get set }
-
Return Order instance
Declaration
Swift
@objc fileprivate(set) public lazy var orders: Orders { get set }
-
Return Aisle instance
- Deprecated : aisles is now only available as a screen object property.
Declaration
Swift
@available(*, deprecated, message: "aisles is now only available as a screen object property (> 2.5.0﹚.") fileprivate(set) public lazy var aisles: Aisles { get set }
-
Return Cart instance
Declaration
Swift
@objc fileprivate(set) public lazy var cart: Cart { get set }
-
Return Products instance
Declaration
Swift
@objc fileprivate(set) public lazy var products: Products { get set }
-
Campaign Tracking. Campaign is now available as a screen object property but you may use this method for notification tracking
Declaration
Swift
@objc fileprivate(set) public lazy var campaigns: Campaigns { get set }
-
Return InternalSearch instance
- Deprecated : internalSearch is now only available as a screen object property.
Declaration
Swift
@available(*, deprecated, message: "internalSearch is now only available as a screen object property (> 2.5.0﹚.") @objc fileprivate(set) public lazy var internalSearches: InternalSearches { get set }
-
Return CustomTreeStructures instance
- Deprecated : customTreeStructures is now only available as a screen object property.
Declaration
Swift
@available(*, deprecated, message: "customTreeStructures is now only available as a screen object property (> 2.5.0﹚.") @objc fileprivate(set) public lazy var customTreeStructures: CustomTreeStructures { get set }
-
Return MediaPlayers instance
Declaration
Swift
@objc fileprivate(set) public lazy var mediaPlayers: MediaPlayers { get set }
-
Campaign Tracking. Campaign is now available as a screen object property but you may use this method for notification tracking
Declaration
Swift
@objc fileprivate(set) public lazy var mvTestings: MvTestings { get set }
-
SDK Version
Declaration
Swift
@objc fileprivate(set) public lazy var sdkVersion: String { get set }
-
Initialisation with default configuration
Declaration
Swift
public convenience override init()
-
Initialisation with a custom configuration
Declaration
Swift
@objc public convenience init(configuration: [String : String])
Parameters
configuration
map that contains key/values. See TrackerConfigurationKeys
-
Undocumented
Declaration
Swift
@objc public func applicationDidEnterForeground()
-
Get the current configuration (read-only)
Declaration
Swift
@objc public var config: [String : String] { get }
-
Set a new configuration
Declaration
Swift
@objc 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 MUST 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
@objc 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
@objc 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
@objc 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
@objc 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
@objc 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
- Deprecated : Since 2.16.0, secure mode is forced
Declaration
Swift
@available(*, deprecated, message: "since 2.16.0, secure mode forced") @objc 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
@objc 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
-
Enable ignore limited ad tracking
Declaration
Swift
@objc public func setIgnoreLimitedAdTrackingEnabled(_ 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
-
Enable send hits when opt out
Declaration
Swift
@objc public func setSendHitWhenOptOutEnabled(_ 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
@objc 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
-
Ensures that all hits are sent only in foreground if set to true. (default: false)
Declaration
Swift
@available(*, deprecated, message: "use setSendOnApplicationState instead") @objc public func setSendOnlyWhenAppActive(_ 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
-
Ensures that all hits are sent only in allowed states
Declaration
Swift
public func setSendOnApplicationState(_ state: SendApplicationState, sync: Bool = false, completionHandler: ((_ isSet: Bool) -> Void)?)
Parameters
state
allowed state to send hit
sync
perform the operation synchronously (optional, default: false)
completionHandler
called when the operation has been done
-
Set new pixel path
Declaration
Swift
@objc 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
@objc 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
-
Enable the campaign persistance
Declaration
Swift
@objc 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
@objc 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
@objc 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
-
Set a new Max Hit Size
Declaration
Swift
@objc public func setMaxHitSize(_ maxHitSize: Int)
Parameters
maxHitSize
new max hit size
-
Set a new uuid duration
Declaration
Swift
@objc public func setUUIDDuration(_ uuidDuration: Int)
Parameters
uuidDuration
new uuid duration
-
Set a new uuid expiration mode
Declaration
Swift
public func setUUIDExpirationMode(_ uuidExpirationMode: UUIDExpirationModeKey)
Parameters
uuidExpirationMode
UUIDExpirationModeKey
-
Set a new proxy type
Declaration
Swift
public func setProxyType(_ proxyType: ProxyTypeKey)
Parameters
proxyType
ProxyTypeKey
-
Set a new proxy address
Declaration
Swift
public func setProxyAddress(_ proxyAdress: String)
Parameters
proxyAddress
new proxy address
-
Add a parameter in the hit querystring
Declaration
Swift
@discardableResult @objc 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
@discardableResult @objc 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
@discardableResult @objc(setStringParam:value:) public func setParam(_ key: String, value: String) -> Tracker
Parameters
key
parameter key
value
string parameter value
Return Value
the current tracker
-
Add a property in the hit querystring
Declaration
Swift
@discardableResult @objc public func setProp(_ key: String, value: String, persistent: Bool) -> Tracker
Parameters
key
parameter key
value
string property value
persistent
persistent option
Return Value
the current tracker
-
Add properties in the hit querystring
Declaration
Swift
@discardableResult @objc public func setProps(_ props: [String : String], persistent: Bool) -> Tracker
Parameters
props
properties map
persistent
persistent option
Return Value
the current tracker
-
get a property
Declaration
Swift
@discardableResult @objc public func getProp(_ key: String) -> Param?
Parameters
key
parameter key
Return Value
param object
-
get all properties
Declaration
Swift
@discardableResult @objc public func getProps() -> [Param]
Return Value
param object list
-
remove property from the hit querystring
Declaration
Swift
@objc public func delProp(_ key: String)
Parameters
key
property key
-
remove all properties
Declaration
Swift
@objc public func delProps()
-
Add a parameter in the hit querystring
Declaration
Swift
@discardableResult @objc(setStringParam:value:options:) 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
@discardableResult @objc(setIntParam:value:) 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
@discardableResult @objc(setIntParam:value:options:) 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
@discardableResult @objc(setFloatParam:value:) 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
@discardableResult @objc(setFloatParam:value:options:) 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
@discardableResult @objc(setDoubleParam:value:) 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
@discardableResult @objc(setDoubleParam:value:options:) 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
@discardableResult @objc(setBoolParam:value:) 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
@discardableResult @objc(setBoolParam:value:options:) 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
@discardableResult @objc(setArrayParam:value:) 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
@discardableResult @objc(setArrayParam:value:options:) 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
@discardableResult @objc(setDictionaryParam:value:) 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
@discardableResult @objc(setDictionaryParam:value:options:) 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
@objc 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
@objc public func resetScreenContext()
-
Sends all tracking objects added
Declaration
Swift
@objc public func dispatch()
-
Get the user id
Declaration
Swift
@objc public func getUserId() -> String
Return Value
the user id depending on configuration (uuid, idfv)
-
Set a custom user id
Declaration
Swift
@objc public func setUserId(userId: String)
Parameters
userId
the userID. if hashUserId is enabled, the hash will be performed on this userID
-
Get lifecycle metrics
Declaration
Swift
@objc public func getLifecycleMetrics() -> [String : Any]
Return Value
the map which contains lifecycle metrics computed by the SDK
-
Get last crash informations
Declaration
Swift
@objc public func getCrashInformation() -> [String : Any]
Return Value
the map which contains lifecycle metrics computed by the SDK
-
Disable user identification.
Declaration
Swift
@available(*, deprecated, message: "Use ATInternet.optOut instead") @objc public class var optOut: Bool { get set }
-
Disable user identification.
Declaration
Swift
@available(*, deprecated, message: "Use ATInternet.optOut instead") @objc public class var doNotTrack: Bool { get set }
-
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
@objc public class var handleCrash: Bool { get set }
-
Undocumented
Declaration
Swift
var backgroundTaskEnabled: Bool { get }
-
Undocumented
Declaration
Swift
var sendOnApplicationState: SendApplicationState { get }