目录
此内容是否有帮助?

# 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:

  1. Install: behavior of APP installation,the corresponding type is ThinkingAnalyticsAutoTrackType.APP_INSTALL
  2. Open APP: including activiting APP and resuming APP from the background, the corresponding type is ThinkingAnalyticsAutoTrackType.APP_START
  3. Close APP: including disabling the APP and calling in the background, the corresponding type is ThinkingAnalyticsAutoTrackType.APP_END
  4. Crash:Record crash information when the APP crashes, the corresponding type is ThinkingAnalyticsAutoTrackType.APP_CRASH

pay attention to auto-tracking event:

  1. The auto-tracking event is implemented in the native SDK, so Dynamic Public Properties cannot be added to the automatic collection event at present.
  2. 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'}
});