ThinkingAnalyticsAPI class

Official Thinking Analytics API for tracking events and user properties.

Your should get the instance of ThinkingAnalyticsAPI by calling getInstance with your APP ID of Thinking Analytics project and URL of receiver:

final ThinkingAnalyticsAPI ta = await ThinkingAnalyticsAPI.getInstance('APP_ID', 'https://SERVER_URL');

The you could user the ThinkingAnalyticsAPI instance to track events:

// track an simple event
ta.track('example_event');

Constructors

ThinkingAnalyticsAPI.private(String _appId)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearSuperProperties() → void
Clears super properties.
createLightInstance() Future<ThinkingAnalyticsAPI>
Creates a light instance.
enableAutoTrack(List<ThinkingAnalyticsAutoTrackType> autoTrackTypes) → void
Enable auto track events.
enableAutoTrackWithProperties(int autoTrackTypes, Map<String, dynamic>? autoTrackEventProperties) → void
enableThirdPartySharing([dynamic type, dynamic params]) → void
Enable three-party data synchronization.
enableTracking(bool enabled) → void
Pause/resume SDK functions.
flush() → void
Uploads the cached data immediately.
getDeviceId() Future<String?>
Gets the device ID.
getDistinctId() Future<String?>
Gets the current distinct ID.
getPresetProperties() Future<TDPresetProperties>
Gets super properties
getPresetPropertiesMap() Future<Map<String, dynamic>?>
Gets super properties
getSuperProperties() Future<Map<String, dynamic>?>
Gets super properties
identify(String distinctId) → void
Sets the distinct ID.
login(String accountId) Future<void>
Sets the account ID.
logout() Future<void>
Clears the account ID.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optInTracking() → void
Opts in the SDK being opt outed.
optOutTracking([bool deleteUser = false]) → void
Stops the SDK function.
setAutoTrackProperties(List<ThinkingAnalyticsAutoTrackType> autoTrackTypes, Map<String, dynamic> autoTrackEventProperties) → void
setDynamicSuperProperties(Map<String, dynamic> f()) → void
Sets the dynamic super properties.
setSuperProperties(Map<String, dynamic> properties) → void
Sets super properties.
setTrackStatus(TATrackStatus status) → void
Switch reporting status PAUSE STOP SAVE_ONLY NORMAL
timeEvent(String eventName) → void
Starts the timer for the given eventName.
toString() String
A string representation of this object.
inherited
track(String eventName, {Map<String, dynamic>? properties, DateTime? dateTime, String? timeZone}) → void
Tracks an event.
trackEventModel(TrackEventModel eventModel) → void
Special Event Reporting First event: With #first_check_id field with parameter extraID, event type track, and #first_check_id default device id.
unsetSuperProperty(String property) → void
Deletes a property from current super properties.
userAdd(Map<String, num> properties) → void
Updates user properties of num type by adding a value.
userAppend(Map<String, List> properties) → void
Updates user properties of list type by appending some elements.
userDelete() → void
Deletes the user profile from TA server.
userSet(Map<String, dynamic> properties) → void
Sets user properties.
userSetOnce(Map<String, dynamic> properties) → void
Sets user properties only once.
userUniqAppend(Map<String, List> properties) → void
The element appended to the library needs to be done to remove the processing,and then import.
userUnset(String property) → void
Deletes a property from the user properties.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

calibrateTime(int timestamp) → void
Calibrate SDK time with current Unix timestamp
calibrateTimeWithNtp(String ntpServer) → void
Calibrate SDK time with a given NTP server.
enableLog() → void
Enable detail logs of data tracking.
getInstance(String appId, String serverUrl, {String? timeZone, ThinkingAnalyticsMode? mode, bool? enableEncrypt, TASecretKey? secretKey}) Future<ThinkingAnalyticsAPI>
Gets instance of ThinkingAnalyticsAPI.