# Automatically Track Events
# 1. Enable Auto-Tracking
You can call enableAutoTrack
and pass in a List of type ThinkingAnalyticsAutoTrackType
to enable the auto-tracking function:
- Install: behavior of APP installation,the corresponding type is
ThinkingAnalyticsAutoTrackType.APP_INSTALL
- Open APP: including activiting APP and resuming APP from the background, the corresponding type is
ThinkingAnalyticsAutoTrackType.APP_START
- Close APP: including disabling the APP and calling in the background, the corresponding type is
ThinkingAnalyticsAutoTrackType.APP_END
- Crash:Record crash information when the APP crashes, the corresponding type is
ThinkingAnalyticsAutoTrackType.APP_CRASH
pay attention to auto-tracking event:
- The auto-tracking event is implemented in the native SDK, so Dynamic Public Properties cannot be added to the automatic collection event at present.
- If you need to set the distinct ID or public properties, please complete the settings before enabling automatic event collection.
Example of enabling auto-tracking:
ta.enableAutoTrack([
ThinkingAnalyticsAutoTrackType.APP_START,
ThinkingAnalyticsAutoTrackType.APP_END,
ThinkingAnalyticsAutoTrackType.APP_INSTALL,
ThinkingAnalyticsAutoTrackType.APP_CRASH,
]);
# 2. Set Auto-tracking Event Public Properties
You can call setAutoTrackProperties
to set or update custom properties
ta.setAutoTrackProperties([
ThinkingAnalyticsAutoTrackType.APP_START,
], {
'auto_test': 'stu',
'auto_arr': [1, 2, 3],
'auto_obj': {'obj_test': 'xxx'}
});