@thinkingai/ae-cli 6.1.38 → 6.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/README.md +2 -0
  2. package/README.zh.md +2 -0
  3. package/dist/{ai-monitor-UL2O7J4X.js → ai-monitor-DST4NDOK.js} +5 -5
  4. package/dist/ai-monitor.js +7 -7
  5. package/dist/{auth-ERWVKQDG.js → auth-BD3NIY3T.js} +3 -3
  6. package/dist/{automation-OQ647CSW.js → automation-IMDCJUML.js} +85 -9
  7. package/dist/{capability-HPP6E3ZX.js → capability-3NJOQHZQ.js} +3 -3
  8. package/dist/{chunk-DKOGWIYQ.js → chunk-24DCOJBJ.js} +2 -2
  9. package/dist/{chunk-SHB7A2JE.js → chunk-2RORKIF6.js} +2 -2
  10. package/dist/{chunk-HBI7IQH3.js → chunk-6NJZSWUT.js} +3 -28
  11. package/dist/{chunk-QPUPWGZ3.js → chunk-DTODOQ6T.js} +1 -1
  12. package/dist/{chunk-PCQTBRPT.js → chunk-FRJUB66C.js} +1 -1
  13. package/dist/{chunk-ZLJZPPPV.js → chunk-IY5G42YY.js} +2 -2
  14. package/dist/{chunk-JRXSLFCA.js → chunk-KBJHBVO7.js} +1 -1
  15. package/dist/{chunk-CYZV5AXW.js → chunk-KE5WGBXS.js} +2 -1
  16. package/dist/chunk-N2MAYIRU.js +32 -0
  17. package/dist/{chunk-DULCIC67.js → chunk-SQEK6S4X.js} +2 -3
  18. package/dist/{chunk-VPLRZSMY.js → chunk-STHIGWWC.js} +10 -1
  19. package/dist/{chunk-BWEQIKA3.js → chunk-TVSGS5QB.js} +5 -5
  20. package/dist/{chunk-LXRALNNA.js → chunk-UK7HQ4IL.js} +1 -1
  21. package/dist/{chunk-NDX4VJO7.js → chunk-VXKKTUU2.js} +2 -2
  22. package/dist/{chunk-E5CJI7L3.js → chunk-WRYXVIJP.js} +1 -1
  23. package/dist/{compat-check-WRPEFB5N.js → compat-check-7VBBE7KO.js} +1 -1
  24. package/dist/{config-IS33K45R.js → config-LFRZBPH5.js} +3 -3
  25. package/dist/{context-Y2A6QIS3.js → context-WJQGJD6F.js} +1 -1
  26. package/dist/{data-integration-EIF5QHYF.js → data-integration-KMJWYAKK.js} +2 -1
  27. package/dist/index.js +34 -32
  28. package/dist/{memory-6QMZS4HF.js → memory-VPOPSU52.js} +3 -3
  29. package/dist/{metadata-TMAXVLOL.js → metadata-AR64J76Z.js} +5 -5
  30. package/dist/{model-LEYRQKOS.js → model-2F2354QP.js} +1 -1
  31. package/dist/{personal-semantic-preference-RMZEDRCJ.js → personal-semantic-preference-BCOSI4DO.js} +4 -4
  32. package/dist/{project-semantic-UD3OAZ6K.js → project-semantic-DJLXAXLD.js} +4 -4
  33. package/dist/{sync-GVF3OI2U.js → sync-4TUIQ2PZ.js} +3 -3
  34. package/dist/{te-agent-S7UH657Z.js → te-agent-EMDWA3M6.js} +4 -4
  35. package/dist/{te-analysis-SJIE5OZY.js → te-analysis-XHAMRMTQ.js} +5 -5
  36. package/dist/{te-community-VNHJDEID.js → te-community-JSUSZEYH.js} +4 -4
  37. package/dist/{te-dataops-AO4OQBQV.js → te-dataops-I264BUTI.js} +2 -2
  38. package/dist/{te-engage-EZJRFG3Q.js → te-engage-XNMQYO5N.js} +68 -16
  39. package/dist/{te-experiment-R2MNSAKV.js → te-experiment-5SCHMYVO.js} +4 -4
  40. package/dist/{te-kb-C44A4BHM.js → te-kb-QQ53TNRZ.js} +44 -13
  41. package/dist/{te-system-DB5Z3LLF.js → te-system-Z4VEB6PL.js} +1 -1
  42. package/dist/{te-team-J52STTEZ.js → te-team-V6BBI52R.js} +87 -6
  43. package/dist/{things-G2QFXDK7.js → things-THHGDSEC.js} +4 -4
  44. package/dist/{update-GEKOZMHU.js → update-53ZUXWV5.js} +2 -2
  45. package/dist/{web-runtime-5M7PRY7R.js → web-runtime-ZJHOIPKX.js} +4 -4
  46. package/dist/{workspace-RZESYB6T.js → workspace-W5ZPVWJS.js} +3 -3
  47. package/package.json +3 -3
  48. package/skills/ae-automation/SKILL.md +6 -2
  49. package/skills/ae-automation/references/cli.md +9 -3
  50. package/skills/ae-engage/SKILL.md +6 -1
  51. package/skills/ae-engage/references/common-metric.md +47 -1
  52. package/skills/ae-engage/references/flow-metric-update.md +1 -1
  53. package/skills/ae-engage/references/task-metric-update.md +1 -1
  54. package/skills/ae-experiment/SKILL.md +1 -1
  55. package/skills/ae-experiment/references/save_experiment.md +1 -1
  56. package/skills/ae-kb/SKILL.md +8 -6
  57. package/skills/ae-kb/references/query-workflow.md +5 -1
  58. package/skills/ae-team/SKILL.md +7 -3
  59. package/skills/ae-team/references/copy-to-personal.md +7 -0
  60. package/skills/ae-team/references/promote.md +7 -0
  61. package/skills/ae-team/references/update.md +3 -3
  62. package/skills/ae-tracking-matrix/SKILL.md +0 -170
  63. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  64. package/skills/ae-tracking-matrix/i18n.yaml +0 -12
  65. package/skills/ae-tracking-matrix/references/ae-capabilities.md +0 -93
  66. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +0 -30
  67. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +0 -256
  68. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +0 -213
  69. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +0 -407
  70. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +0 -218
  71. package/skills/ae-tracking-matrix/references/categories/casual_music.md +0 -112
  72. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +0 -301
  73. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +0 -356
  74. package/skills/ae-tracking-matrix/references/categories/fishing.md +0 -775
  75. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +0 -89
  76. package/skills/ae-tracking-matrix/references/categories/idle_card.md +0 -27
  77. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +0 -415
  78. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +0 -133
  79. package/skills/ae-tracking-matrix/references/categories/merge.md +0 -639
  80. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +0 -406
  81. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +0 -230
  82. package/skills/ae-tracking-matrix/references/categories/music.md +0 -137
  83. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +0 -414
  84. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +0 -199
  85. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +0 -158
  86. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +0 -546
  87. package/skills/ae-tracking-matrix/references/categories/rpg.md +0 -195
  88. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +0 -115
  89. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +0 -151
  90. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +0 -260
  91. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +0 -232
  92. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +0 -359
  93. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +0 -365
  94. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +0 -211
  95. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +0 -132
  96. package/skills/ae-tracking-matrix/references/category-registry.md +0 -77
  97. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +0 -230
  98. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +0 -406
  99. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +0 -128
  100. package/skills/ae-tracking-matrix/references/eval-cases.md +0 -74
  101. package/skills/ae-tracking-matrix/references/naming-dict.md +0 -238
  102. package/skills/ae-tracking-matrix/references/optimization-checklist.md +0 -85
  103. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +0 -142
  104. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +0 -47
  105. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +0 -794
  106. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +0 -94
  107. package/skills/ae-tracking-matrix/references/scene-routing.md +0 -80
  108. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +0 -3787
  109. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +0 -827
  110. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +0 -655
  111. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +0 -953
  112. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +0 -1128
  113. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +0 -714
  114. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +0 -1268
  115. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +0 -776
  116. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +0 -182
  117. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +0 -2755
  118. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +0 -1182
  119. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +0 -1300
  120. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +0 -1369
  121. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +0 -1692
  122. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +0 -902
  123. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +0 -763
  124. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +0 -1107
  125. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +0 -1532
  126. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +0 -845
  127. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +0 -228
  128. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +0 -149
  129. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +0 -407
  130. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +0 -163
  131. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +0 -149
  132. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +0 -153
  133. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +0 -232
  134. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +0 -314
  135. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +0 -117
  136. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +0 -148
  137. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +0 -645
  138. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +0 -307
  139. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +0 -347
  140. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +0 -72
  141. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +0 -264
  142. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +0 -566
  143. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +0 -409
  144. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +0 -446
  145. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +0 -557
  146. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +0 -457
  147. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +0 -490
  148. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +0 -523
  149. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +0 -484
  150. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +0 -442
  151. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +0 -391
  152. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +0 -91
  153. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +0 -635
  154. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +0 -113
  155. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +0 -466
  156. package/skills/ae-tracking-matrix/references/standard-base/README.md +0 -22
  157. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +0 -174
  158. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +0 -20
  159. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +0 -7
  160. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +0 -14
  161. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +0 -370
  162. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +0 -47
  163. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +0 -37
  164. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +0 -27
  165. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +0 -23
  166. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +0 -14
  167. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +0 -46
  168. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +0 -13
  169. package/skills/ae-tracking-matrix/references/system-fields.md +0 -297
  170. package/skills/ae-tracking-matrix/references/te-field-translations.md +0 -1791
  171. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +0 -232
  172. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +0 -829
  173. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +0 -355
  174. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +0 -283
  175. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +0 -168
  176. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +0 -205
  177. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +0 -75
  178. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +0 -36
  179. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +0 -107
  180. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +0 -114
  181. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +0 -53
  182. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +0 -166
  183. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +0 -674
  184. package/skills/ae-tracking-matrix/scripts/plan_contract.py +0 -200
  185. package/skills/ae-tracking-matrix/scripts/plan_types.py +0 -60
  186. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +0 -169
  187. package/skills/ae-tracking-matrix/scripts/sync_plan.py +0 -296
  188. package/skills/ae-tracking-matrix/scripts/upload_plan.py +0 -340
@@ -1,776 +0,0 @@
1
- ---
2
- code: flutter_sdk_installation
3
- name: "Flutter"
4
- wikiToken: OxdhwoyTDiS4kLknBKBcxZH3n7C
5
- parentWikiToken: EaDPwgIujiz2GKk0rWxct8ZNn4g
6
- updateTime: 1763002927000
7
- sourceUrl: https://docs-v2.thinkingdata.cn/?version=6.0&lan=zh-CN&code=flutter_sdk_installation
8
- ---
9
-
10
- # Flutter
11
-
12
- This guide will introduce how to use Flutter SDK to integrate into your project. We recommend reading the data rules chapter before starting integration.
13
-
14
- **Latest Version: **3.3.1
15
-
16
- **Update Time: **2025-11-10
17
-
18
- **Resource Download:\*\*** \*\*Source code
19
-
20
- ::: warning Note
21
-
22
- This document applies to v3.0.0 and later versions. For historical versions, please refer to Flutter Integration Guide (V2)
23
-
24
- :::
25
-
26
- ### 1. SDK Integration
27
-
28
- Add `thinking_analytics` dependency in your Flutter project's `pubspec.yaml` file:
29
-
30
- ```
31
- dependencies:
32
- thinking_analytics: ^3.3.1
33
- ```
34
-
35
- <!-- unsupported block: 19 -->
36
-
37
- Versions after 3.3.0 support Flutter For OpenHarmony for HarmonyOS platform. Currently supports Flutter 3.7.12 and 3.22.0 versions
38
-
39
- Features not supported on HarmonyOS platform:
40
-
41
- 1. Custom timezone feature not supported
42
- 1. Dynamic common properties for auto-tracking events not supported
43
- 1. JS integration not supported
44
-
45
- ### 2. Initialization
46
-
47
- ThinkingData SDK needs to be initialized after user agrees to Privacy Policy
48
-
49
- <!-- unsupported block: 19 -->
50
-
51
- Versions 3.3.0 and later do not need await
52
-
53
- ```
54
- // Determine whether to enable data collection based on privacy policy
55
- import 'package:thinking_analytics/td_analytics.dart';
56
- if (privacy policy authorized)
57
- {
58
- //SDK initialization
59
- await TDAnalytics.init(APPID, SERVER_URL);
60
- }
61
- ```
62
-
63
- Parameter Description:
64
-
65
- - `APPID`: Your project's APPID, can be obtained from TE backend project management page
66
- - `SERVER_URL`: Data upload URL
67
- - If you are using cloud service, enter: https://global-receiver-ta.thinkingdata.cn
68
- - If you are using private deployment version, please bind domain to data collection address and configure HTTPS certificate: https://YOUR_DATA_COLLECTION_DOMAIN
69
- <!-- unsupported block: 34 -->
70
-
71
- Since Android 9.0+ restricts HTTP requests by default, please make sure to use HTTPS protocol
72
-
73
- ### 3. Common Features
74
-
75
- Before using common features, we recommend you first understand the user identification rules. SDK will generate random number as visitor ID by default and persistently store it locally. Before user login, visitor ID will be used as identity identification ID. Note: Visitor ID will change when user reinstalls App or changes device.
76
-
77
- #### 3.1 Setting Account ID
78
-
79
- When user logs in, you can call `login` to set user's account ID. TE platform will use account ID as identity identification ID, and the set account ID will be retained until `logout` is called. Multiple calls to `login` will overwrite the previous account ID.
80
-
81
- ```
82
- // User's login unique identifier, this data corresponds to #account_id in reported data, now #account_id value is TA
83
- TDAnalytics.*login*("TA");
84
- ```
85
-
86
- `login` can be called multiple times. Each call will check whether the passed account ID is the same as the previously saved ID. If same, the call will be ignored. If different, it will overwrite the previous ID.
87
-
88
- <!-- unsupported block: 34 -->
89
-
90
- **This method will not upload login event**
91
-
92
- #### 3.2 Setting Common Event Properties
93
-
94
- Common event properties refer to properties that every event will have. You can call `setSuperProperties` to set common event properties. We recommend you set common event properties before sending events. For some important properties, such as user's membership level, source channel, etc., these properties need to be set in every event. In this case, you can set these properties as common event properties.
95
-
96
- ```
97
- TDAnalytics.setSuperProperties({
98
- "channel": "ta",//string
99
- "age": 1,//number
100
- "isSuccess": true,//boolean
101
- "birthday": DateTime.now(),//time
102
- "object": {"key": "value"},//object
103
- "object_arr": [{"key": "value"}],//object array
104
- "arr": ["value"]//array
105
- });
106
- ```
107
-
108
- Common event properties will be saved to cache and don't need to be called every time App starts. If `setSuperProperties` is called to upload a previously set common event property, it will overwrite the previous property.
109
-
110
- - Key is the property name, string type, must start with a letter, contain numbers, letters and underscore "\_", maximum 50 characters, case insensitive, TE will convert to lowercase
111
- - Value is the property value, supports string, number, boolean, time, object, object array, array
112
- <!-- unsupported block: 34 -->
113
-
114
- **Event property and user property requirements are consistent with common event properties**
115
-
116
- #### 3.3 Enabling Auto-tracking
117
-
118
- The following sample code enables install, start, close events. If you want to learn more about SDK auto-tracking capabilities, you can view auto-tracking feature detailed introduction
119
-
120
- ```
121
- TDAnalytics.*enableAutoTrack*(TDAutoTrackEventType.*APP_START *|
122
- TDAutoTrackEventType.*APP_END *|
123
- TDAutoTrackEventType.*APP_INSTALL *|
124
- TDAutoTrackEventType.*APP_CRASH*);
125
- ```
126
-
127
- #### 3.4 Sending Events
128
-
129
- We recommend you set event properties and sending conditions according to your previously prepared document. Event name is `String` type, must start with a letter, can contain numbers, letters and underscore "\_", maximum 50 characters, case insensitive.
130
-
131
- ```
132
- TDAnalytics.track('product_buy', properties: <String, dynamic>{'product_name': 'product name'});
133
- ```
134
-
135
- Event name is string type, must start with a letter, can contain numbers, letters and underscore "\_", maximum 50 characters.
136
-
137
- #### 3.5 Setting User Properties
138
-
139
- For general user properties, you can call `userSet` to set them. Properties uploaded using this interface will overwrite previous property values. If the user property did not exist before, it will create a new user property. The type will be consistent with the uploaded property type. Here is an example of setting username:
140
-
141
- ```
142
- TDAnalytics.userSet(<String, dynamic>{'user_name': 'TA'}); //username is TA
143
- TDAnalytics.userSet(<String, dynamic>{'user_name': 'TE'}); //userName is TE
144
- ```
145
-
146
- ### 4. Best Practices
147
-
148
- The following sample code includes all the above operations. We recommend using the following steps:
149
-
150
- ```
151
- import 'package:thinking_analytics/td_analytics.dart';
152
- if (privacy policy authorized)
153
- {
154
- //SDK initialization
155
- await TDAnalytics.*init*('APP_ID', 'https://SERVER_URL');
156
- //Enable auto-tracking events
157
- TDAnalytics.*enableAutoTrack*(TDAutoTrackEventType.*APP_START *|
158
- TDAutoTrackEventType.*APP_END *|
159
- TDAutoTrackEventType.*APP_INSTALL *|
160
- TDAutoTrackEventType.*APP_CRASH*);
161
- //If user is logged in, you can set user's account ID as unique identity
162
- TDAnalytics.login('TA');
163
- //After setting common event properties, every event will have common event properties
164
- TDAnalytics.setSuperProperties({
165
- "channel": "ta",//string
166
- "age": 1,//number
167
- "isSuccess": true,//boolean
168
- "birthday": DateTime.now(),//time
169
- "object": {"key": "value"},//object
170
- "object_arr": [{"key": "value"}],//object array
171
- "arr": ["value"]//array
172
- });
173
- //Send event
174
- TDAnalytics.track('product_buy', properties: <String, dynamic>{'product_name': 'product name'});
175
- //Set user properties
176
- TDAnalytics.userSet(<String, dynamic>{'user_name': 'TE'});
177
- }
178
- ```
179
-
180
- ---
181
-
182
- # Advanced Guide
183
-
184
- ### 1. Setting User ID
185
-
186
- SDK instance will use random UUID as the default visitor ID for each user by default. This ID will be used as the identity identification ID when user is not logged in. Note that visitor ID will change when user reinstalls App or changes device.
187
-
188
- #### 1.1 Setting Visitor ID
189
-
190
- ::: tip Tip
191
-
192
- Generally, you don't need to customize visitor ID. Please make sure you understand the user identification rules before setting visitor ID.
193
-
194
- If you need to replace visitor ID, you should call it immediately after SDK initialization is completed. Do not call it multiple times to avoid generating useless accounts
195
-
196
- :::
197
-
198
- If your App has its own visitor ID management system for each user, you can call `setDistinctId` to set visitor ID:
199
-
200
- ```
201
- // Set visitor ID to Thinker
202
- TDAnalytics.*setDistinctId*("Thinker");
203
- ```
204
-
205
- If you need to get the current visitor ID, you can call `getDistinctId`:
206
-
207
- ```
208
- //Return visitor ID
209
- String distinctId = await TDAnalytics.getDistinctId();
210
- ```
211
-
212
- #### 1.2 Setting Account ID
213
-
214
- When user logs in, you can call `login` to set user's account ID. TE platform will use account ID as identity identification ID, and the set account ID will be retained until `logout` is called. Multiple calls to `login` will overwrite the previous account ID.
215
-
216
- ```
217
- // User's login unique identifier, this data corresponds to #account_id in reported data, now #account_id value is TA
218
- TDAnalytics.login("TA");
219
- ```
220
-
221
- <!-- unsupported block: 34 -->
222
-
223
- **This method will not upload login event**
224
-
225
- #### 1.3 Clearing Account ID
226
-
227
- After user logs out, you can call `logout` to clear account ID. Before the next `login` call, visitor ID will be used as identity identification ID.
228
-
229
- ```
230
- TDAnalytics.logout();
231
- ```
232
-
233
- We recommend you call `logout` at explicit logout events, such as when user performs account deregistration action, rather than when closing App.
234
-
235
- <!-- unsupported block: 34 -->
236
-
237
- **This method will not upload logout event**
238
-
239
- ### 2. Sending Events
240
-
241
- After SDK initialization is completed, you can perform data tracking and collect user behavior information. Regular events can generally meet business scenario requirements. You can also use first-time, updatable events according to your actual business scenarios.
242
-
243
- #### 2.1 Regular Events
244
-
245
- You can call `track` to upload events. We recommend you set event properties and sending conditions according to your previously prepared document. Here is an example of user purchasing a product:
246
-
247
- ```
248
- TDAnalytics.track('pruoduct_buy', properties: <String, dynamic>{'product_name': 'product name'});
249
- ```
250
-
251
- #### 2.2 First-time Events
252
-
253
- First-time events refer to events that will only be recorded once for a certain device or other dimension ID. For example, in some scenarios, you may want to record an activation event on a certain device, you can use first-time events to report data.
254
-
255
- ```
256
- //Example: report device first-time event, assuming event name is device_activation
257
- var properties = {'key': 'value'};
258
- TDFirstEventModel firstModel =TDFirstEventModel('device_activation','', properties);
259
- TDAnalytics.*trackEventModel*(firstModel);
260
- ```
261
-
262
- If you want to use other dimensions other than device to judge whether it's first-time, you can customize first_check_id for first-time events:
263
-
264
- ```
265
- // Set user ID as first_check_id for first-time event, to collect user first-time activation event
266
- var properties = {'key': 'value'};
267
- TDFirstEventModel firstModel =TDFirstEventModel('device_activation','TA', properties);
268
- TDAnalytics.trackEventModel(firstModel);
269
- ```
270
-
271
- <!-- unsupported block: 34 -->
272
-
273
- Note: Since the verification of whether it's first-time is completed on the server side, first-time events will be delayed by 1 hour before being stored in database.
274
-
275
- #### 2.3 Updatable Events
276
-
277
- You can use updatable events to implement the need to modify event data in specific scenarios. Updatable events need to specify an ID that identifies the event, and pass it when creating the updatable event object. TE backend will determine the data to be updated based on event name and event ID.
278
-
279
- ```
280
- // Example: report updatable event, assuming event name is UPDATABLE_EVENT
281
- // After reporting, event property status is 3, price is 100
282
- var properties = {
283
- 'status': 3,
284
- 'price': 100
285
- };
286
- TDUpdatableEventModel updateModel = TDUpdatableEventModel('UPDATABLE_EVENT', 'test_event_id', properties);
287
- TDAnalytics.trackEventModel(updateModel);
288
-
289
- // After reporting, event property status is updated to 5, price remains unchanged
290
- var properties_new = {
291
- 'status': 5
292
- };
293
- var updateModel_new = TDUpdatableEventModel('UPDATABLE_EVENT', 'test_event_id', properties_new);
294
- TDAnalytics.trackEventModel(updateModel_new);
295
- ```
296
-
297
- #### 2.4 Overwritable Events
298
-
299
- Overwritable events are similar to updatable events, the difference is that overwritable events will completely overwrite previous data with the latest data. From the effect, it's equivalent to deleting the previous data and storing the latest data. TE backend will determine the data to be updated based on event name and event ID.
300
-
301
- ```
302
- // Example: report overwritable event, assuming event name is OVERWRITABLE_EVENT
303
- // After reporting, event property status is 3, price is 100
304
- var properties = {
305
- 'status': 3,
306
- 'price': 100
307
- };
308
- var overwriteModel = TDOverWritableEventModel('OVERWRITABLE_EVENT', 'test_event_id', properties);
309
- TDAnalytics.trackEventModel(overwriteModel);
310
-
311
- // After reporting, event property status is 5, price property is deleted
312
- var properties_new = {
313
- 'status': 5
314
- };
315
- var overwriteModel_new = TDOverWritableEventModel('OVERWRITABLE_EVENT', 'test_event_id', properties_new);
316
- TDAnalytics.trackEventModel(overwriteModel_new);
317
- ```
318
-
319
- #### 2.5 Common Event Properties
320
-
321
- Common event properties refer to properties that every event will upload. Based on property update frequency, common event properties are divided into `static common event properties` and `dynamic common event properties`. You can choose different common event property setting methods according to your specific business scenario requirements; we recommend you set common event properties before sending events. For the same event, when common event property, event custom property, preset property have the same Key, we will assign values according to the following priority: `custom property>dynamic common event property>static common event property>preset property`.
322
-
323
- ##### 2.5.1 Static Common Event Properties
324
-
325
- Static common event properties are low-frequency changing properties that every event will have, such as user membership level. After setting static common event properties via `setSuperProperties`, SDK will get the set common event properties as event properties when collecting events.
326
-
327
- ```
328
- Map<String, dynamic> superProperties = {
329
- 'vip_level': 2
330
- };
331
- TDAnalytics.setSuperProperties(superProperties);
332
- ```
333
-
334
- Static common event properties will be saved to cache and don't need to be called every time App starts. If the property already exists, the newly set property will overwrite the original property value; if the property did not exist before, it will create a new property. Besides property setting, we also provide other APIs to operate static common event properties to meet daily business needs.
335
-
336
- ```
337
- // Clear property named SUPER_LIST common property
338
- TDAnalytics.unsetSuperProperty('SUPER_LIST');
339
- // Clear all common properties
340
- TDAnalytics.clearSuperProperties();
341
- //Get all common event properties
342
- await TDAnalytics.getSuperProperties();
343
- ```
344
-
345
- ##### 2.5.2 Dynamic Common Event Properties
346
-
347
- Dynamic common event properties are high-frequency changing properties that every event will have, such as user's coin count. After setting dynamic common property class via `setDynamicSuperProperties`, SDK will automatically get dynamic common event properties when collecting events and add them to the triggered event. Setting dynamic common properties requires passing a function that returns `Map<String, dyanmic>` type. Sample as follows:
348
-
349
- ```
350
- // Set dynamic common properties, dynamic common properties do not support auto-tracking events
351
- TDAnalytics.*setDynamicSuperProperties*((){
352
- return <String, dynamic> {
353
- 'DYNAMIC_DATE': DateTime.now().toUtc(),
354
- };
355
- });
356
- ```
357
-
358
- <!-- unsupported block: 34 -->
359
-
360
- Dynamic common properties currently do not support auto-tracking events.
361
-
362
- #### 2.6 Recording Event Duration
363
-
364
- If you need to record the duration of an event, you can call `timeEvent` to start timing. Configure the event name you want to time. When you upload the event, `#duration` property will be automatically added to your event properties to represent the recorded duration, in seconds. Note that the same event name can only have one timing task.
365
-
366
- ```
367
- //The following example completes the statistics of user staying time on a product page
368
- //User enters product page, start timing
369
- TDAnalytics.timeEvent('stay_shop');
370
- // do some thing...
371
- //User leaves product page, timing ends, "stay_shop" event will have #duration property representing event duration
372
- TDAnalytics.track("stay_shop");
373
- ```
374
-
375
- ### 3. User Properties
376
-
377
- TE platform currently supports the following user property setting interfaces: `userSet`, `userSetOnce`, `userAdd`, `userUnset`, `userDelete`, `userAppend`, `userUniqAppend`
378
-
379
- #### 3.1 userSet
380
-
381
- For general user properties, you can call `userSet` to set them. Properties uploaded using this interface will overwrite previous property values. If the user property did not exist before, it will create a new user property. The type will be consistent with the uploaded property type. Here is an example of setting username.
382
-
383
- ```
384
- TDAnalytics.userSet(<String, dynamic>{'user_name': 'TA'}); //username is TA
385
- TDAnalytics.userSet(<String, dynamic>{'user_name': 'TE'}); //userName is TE
386
- ```
387
-
388
- <!-- unsupported block: 34 -->
389
-
390
- Property format requirements are consistent with event properties.
391
-
392
- #### 3.2 userSetOnce
393
-
394
- If you want to upload a user property that only needs to be set once, you can call `userSetOnce` to set it. When the property already has a value, this information will be ignored. Here is an example of setting first payment time:
395
-
396
- ```
397
- //first_payment_time is 2018-01-01 01:23:45.678
398
- TDAnalytics.userSetOnce(<String, dynamic>{'first_payment_time': '2018-01-01 01:23:45.678'});
399
- //first_payment_time remains 2018-01-01 01:23:45.678
400
- TDAnalytics.userSetOnce(<String, dynamic>{'first_payment_time': '2018-12-31 01:23:45.678'});
401
- ```
402
-
403
- #### 3.3 userAdd
404
-
405
- When you want to upload numeric properties, you can call `userAdd` to perform cumulative operations on the property. If the property has not been set, it will be assigned 0 before calculation. Negative values can be passed, equivalent to subtraction operation. Here is an example of cumulative payment amount:
406
-
407
- ```
408
- //total_revenue is 30
409
- TDAnalytics.userAdd(<String, num>{ 'total_revenue': 30});
410
- //total_revenue is 678
411
- TDAnalytics.userAdd(<String, num>{ 'total_revenue': 648});
412
- ```
413
-
414
- #### 3.4 userUnset
415
-
416
- If you need to reset a user's property, you can call `userUnset` to delete the specified user property value:
417
-
418
- ```
419
- TDAnalytics.userUnset('USER_INT');
420
- ```
421
-
422
- <!-- unsupported block: 34 -->
423
-
424
- userUnset: The passed value is the Key of the property to be cleared.
425
-
426
- #### 3.5 userDelete
427
-
428
- If you want to delete a user, you can call `userDelete` to delete the user. You will no longer be able to query this user's user properties, but the events generated by this user can still be queried:
429
-
430
- ```
431
- TDAnalytics.userDelete();
432
- ```
433
-
434
- #### 3.6 userAppend
435
-
436
- You can call `userAppend` to append elements to `List` type user properties:
437
-
438
- ```
439
- TDAnalytics.userAppend(<String, List>{
440
- 'USER_LIST': ['apple','ball'],
441
- });
442
- ```
443
-
444
- #### 3.7 userUniqAppend
445
-
446
- You can call `userUniqAppend` to append elements to Array type user properties. Calling `userUniqAppend` interface will deduplicate the appended user properties, `userAppend` interface does not deduplicate, user properties can have duplicates.
447
-
448
- ```
449
- //user_list property value is ["apple", "ball"]
450
- TDAnalytics.userAppend(<String, List>{ 'user_list': ['apple','ball']});
451
- //user_list property value is ["apple","apple","ball","cube"]
452
- TDAnalytics.userAppend(<String, List>{ 'user_list': ['apple','cube']});
453
- //user_list property value is ["apple", "ball","cube"]
454
- TDAnalytics.useUniqrAppend(<String, List>{ 'user_list': ['apple','cube']});
455
- ```
456
-
457
- ### 4. Encryption Feature
458
-
459
- SDK supports encryption feature. Client supports AES+RSA to encrypt data, then server decrypts the data. Encryption and decryption capabilities need to be coordinated between client and server. Please consult customer success personnel for details. You can enable data transmission encryption feature when initializing SDK.
460
-
461
- ```
462
- TDConfig config = TDConfig();
463
- config.appId = "APP_ID";
464
- config.serverUrl = "SERVER_URL";
465
- //Configure version number, public key and other secret key information
466
- config.enableEncrypt(1,"publicKey");
467
- TDAnalytics.*initWithConfig*(config);
468
- ```
469
-
470
- ### 5. Enabling Integration with H5 Pages
471
-
472
- If you need to integrate with JavaScript SDK that collects H5 page data, please call the following interface. For details, please refer to H5 and APP SDK Integration section
473
-
474
- ```
475
- controller = WebViewController();
476
- TDAnalytics.setJsBridge(controller);
477
- ```
478
-
479
- ### 6. Other Features
480
-
481
- #### 6.1 Getting Device ID
482
-
483
- After SDK initialization is completed, device ID will be automatically generated and recorded in local cache. For the same app/game, one device's device ID is unchanged. You can call `getDeviceId` to get device ID:
484
-
485
- ```
486
- String deviceId = await TDAnalytics.getDeviceId();
487
- ```
488
-
489
- #### 6.2 Setting Default Timezone
490
-
491
- By default, all data's occurrence time will be set to local time. If your product is distributed in multiple timezones and you want to align data time to a specified timezone, you can pass `timeZone` to set timezone. `timeZone` needs to be a valid timezone string, such as `UTC`, `Asia/Shanghai` etc.
492
-
493
- By default, SDK will use local time when interface is called as event occurrence time for reporting. You can also set default timezone interface to specify default timezone, so all events will align event time according to your set timezone:
494
-
495
- ```
496
- TDConfig config = TDConfig();
497
- config.appId = "appId";
498
- config.serverUrl = "serverUrl";
499
- config.timeZone = "UTC";
500
- TDAnalytics.*initWithConfig*(config);
501
- ```
502
-
503
- <!-- unsupported block: 34 -->
504
-
505
- Aligning event time with specified timezone will lose device local timezone information. If you need to preserve device local timezone information, you currently need to add related properties to events yourself.
506
-
507
- #### 6.3 Time Calibration
508
-
509
- SDK will use local time as event occurrence time by default. If user manually modifies device time, it will affect your business analysis. In this case, you can use time calibration operation to ensure the accuracy of event occurrence time. We provide `timestamp, NTP` two time calibration methods.
510
-
511
- - You can use the current timestamp obtained from server to calibrate SDK time. After that, all calls without specified time, including event data and user property setting operations, will use the calibrated time as occurrence time.
512
-
513
- ```
514
- // 1585633785954 is current unix timestamp in milliseconds, corresponding to Beijing time 2020-03-31 13:49:45
515
- TDAnalytics.calibrateTime(1585633785954);
516
- ```
517
-
518
- - You can also set NTP server address, then SDK will try to get current time from the passed NTP service address and calibrate SDK time. If correct result is not obtained within default timeout (3 seconds), local time will be used for data reporting.
519
-
520
- ```
521
- // Use Apple's NTP service for time calibration
522
- TDAnalytics.*calibrateTimeWithNtp*("time.apple.com");
523
- ```
524
-
525
- <!-- unsupported block: 34 -->
526
-
527
- 1. Using NTP service for time calibration has some uncertainty, we recommend you prefer using timestamp calibration method
528
-
529
- 2. You need to carefully choose your NTP server address to ensure that user devices can quickly get server time under good network conditions
530
-
531
- ---
532
-
533
- # Real-time Debugging
534
-
535
- During SDK integration, you can view SDK logs in IDE console or use TE's Debug feature for real-time debugging.
536
-
537
- ### 1. Printing SDK Logs
538
-
539
- ```
540
- TDAnalytics.*enableLog*(true);
541
- ```
542
-
543
- <!-- unsupported block: 34 -->
544
-
545
- After enabling logs, you can filter ThinkingAnalytics related logs in IDE to observe SDK data reporting.
546
-
547
- ### 2. Enabling Debug Mode
548
-
549
- Enabling Debug mode requires two steps:
550
-
551
- 1. Enable Debug mode on client
552
- Here is sample code for enabling Debug mode on client:
553
-
554
- ```
555
- /*
556
- Set running mode to Debug mode
557
- NORMAL mode: data will be cached and uploaded according to certain caching strategy, default is NORMAL mode; recommended for production environment
558
- Debug mode: data is uploaded one by one. When problems occur, it will alert users via logs and exceptions; not recommended for production environment
559
- DebugOnly mode: only validate data, will not store; not recommended for production environment
560
- */
561
- TDConfig config = TDConfig();
562
- config.appId = "appId";
563
- config.serverUrl = "serverUrl";
564
- config.setMode(TDMode.DEBUG);
565
- TDAnalytics.*initWithConfig*(config);
566
- ```
567
-
568
- 2. Add Debug device in TE backend
569
- To avoid Debug mode going live in production environment, only specified devices can enable Debug mode. Debug mode can only be enabled when Debug mode is enabled on client and device ID is configured in TE backend's "Tracking Management" page's "Debug Data" section.
570
-
571
- Device ID can be obtained through three ways:
572
-
573
- - #device_id property in event data on TE platform
574
- - Client log: Device DeviceId will be printed after SDK initialization completes
575
- - Instance interface call: Get Device ID
576
- <!-- unsupported block: 34 -->
577
-
578
- Debug mode may affect data collection quality and App stability, only use for integration stage data verification, do not use in production environment.
579
-
580
- ---
581
-
582
- # Auto-tracking
583
-
584
- ### 1. Enabling Auto-tracking Events
585
-
586
- You can call `enableAutoTrack` and pass a `TDAutoTrackEventType` type to enable auto-tracking. Currently supports six types:
587
-
588
- - `ta_app_start`: App enters foreground, corresponding type is `TDAutoTrackEventType.APP_START`
589
- - `ta_app_end`: App enters background, corresponding type is `TDAutoTrackEventType.APP_END`
590
- - `ta_app_install`: First open after installation, corresponding type is `TDAutoTrackEventType.APP_INSTALL`
591
- - `ta_app_crash`: App crashes due to uncaught exception, corresponding type is `TDAutoTrackEventType.APP_CRASH`
592
- - `ta_app_view`: Triggered when APP uses Navigator route navigation, corresponding type is `TDAutoTrackEventType.APP_VIEW_SCREEN`
593
- - `ta_app_click`: APP control click event triggered when user clicks control, corresponding type is `TDAutoTrackEventType.APP_CLICK`
594
- Notes about auto-tracking events:
595
-
596
- 1. Auto-tracking events are implemented in native SDK, so dynamic common properties currently cannot be added to auto-tracking events.
597
- 1. If you need to set visitor ID or common properties, please complete setting before enabling auto-tracking events.
598
- Sample code for enabling auto-tracking:
599
-
600
- ```
601
- TDAnalytics.enableAutoTrack(TDAutoTrackEventType.APP_START |
602
- TDAutoTrackEventType.APP_END |
603
- TDAutoTrackEventType.APP_INSTALL |
604
- TDAutoTrackEventType.APP_CRASH|
605
- TDAutoTrackEventType.APP_CLICK|
606
- TDAutoTrackEventType.APP_VIEW_SCREEN);
607
- ```
608
-
609
- ### 2. Detailed Introduction
610
-
611
- #### 2.1 Page View Events
612
-
613
- Triggered when APP uses Navigator route navigation. Detailed event introduction:
614
-
615
- - Event name: ta_app_view
616
- - Preset properties:
617
- `#screen_name`: string type, page name
618
-
619
- `#title`: string type, page title
620
-
621
- `#referrer`: string type, previous address
622
-
623
- - Enable steps:
624
- - Add global listener, add navigatorObservers in MaterialApp
625
-
626
- ```
627
- import 'package:thinking_analytics/autotrack/td_page_view.dart';
628
-
629
- void main() => runApp(new MaterialApp(
630
- navigatorObservers: TDNavigatorObserver.*wrap*([]), home: MyApp()));
631
- ```
632
-
633
- - Call _enableAutoTrack to enable, sample code as follows:_
634
-
635
- ```
636
- TDAnalytics.*enableAutoTrack*(TDAutoTrackEventType.*APP_VIEW_SCREEN*,
637
- autoTrackEventProperties: {
638
- "test_property": "test_property_value"
639
- },
640
- autoTrackPageConfig: TDAutoTrackConfig(
641
- pageConfigs: [
642
- TDAutoTrackPageConfig<Page1>(
643
- screenName: "Page1",
644
- title: "First Page",
645
- ),
646
- TDAutoTrackPageConfig<Page2>(
647
- screenName: "Page2",
648
- title: "Second Page",
649
- ignore: false,
650
- properties: {
651
- "multi_property": "multi_property_value"
652
- },
653
- )
654
- ],
655
- ));
656
- ```
657
-
658
- autoTrackEventProperties: Set auto-tracking common properties
659
-
660
- autoTrackPageConfig: Page view related configuration information, can customize title and screenName for each page, ignore is whether to ignore this page collection, properties is this page's custom properties
661
-
662
- <!-- unsupported block: 19 -->
663
-
664
- Need to enable early, otherwise the first page's lifecycle has passed, cannot collect the first page's view event
665
-
666
- #### 2.1 Element Click Events
667
-
668
- APP control click event triggered when user clicks control
669
-
670
- - Event name: ta_app_click
671
- - Preset properties:
672
- `#screen_name`: string type, page name
673
-
674
- `#title`: string type, page title
675
-
676
- `#element_type`: string type, element type
677
-
678
- `#element_content`: string type, element content
679
-
680
- - Enable steps
681
-
682
- ```
683
- TDAnalytics.*enableAutoTrack*(TDAutoTrackEventType.*APP_CLICK*);
684
- ```
685
-
686
- - Control custom properties
687
- Set custom properties via TDElementKey
688
-
689
- - First parameter: Element ID, corresponds to property #element_id
690
- - properties: Custom properties
691
- - isIgnore: Whether to ignore this control auto-tracking event
692
-
693
- ```
694
- import 'package:thinking_analytics/autotrack/td_autotrack_config.dart';
695
-
696
- ElevatedButton(
697
- key: TDElementKey("Element ID", properties: {"key": "value"},isIgnore: true),
698
- onPressed: () {},
699
- child: Text(
700
- "Button 2",
701
- style: TextStyle(fontSize: 14),
702
- )),
703
- ```
704
-
705
- ### 3. Setting Auto-tracking Event Custom Properties
706
-
707
- You can call `setAutoTrackProperties` to set or update custom properties
708
-
709
- ```
710
- TDAnalytics.*enableAutoTrack*(TDAutoTrackEventType.*APP_START*,
711
- autoTrackEventProperties: {
712
- 'auto_test': 'stu',
713
- 'auto_arr': [1, 2, 3],
714
- 'auto_obj': {'obj_test': 'xxx'}
715
- });
716
- ```
717
-
718
- ---
719
-
720
- # Preset Properties
721
-
722
- ### 1. Preset Properties Description
723
-
724
- Preset properties collected by iOS and Android platforms will have some differences. Please refer to the following documents:
725
-
726
- iOS platform preset properties, Android platform preset properties
727
-
728
- ### 2. Getting Preset Properties
729
-
730
- v2.0.1 and later versions can call `getPresetProperties()` method to get preset properties.
731
-
732
- When server-side tracking needs some preset properties from App side, you can use this method to get App side preset properties and then pass to server.
733
-
734
- ```
735
- //Get property object
736
- TDPresetProperties presetProperties = await TDAnalytics.getPresetProperties();
737
-
738
- //Generate event preset properties
739
- Map<String, dynamic>? eventPresetProperties = presetProperties.toEventPresetProperties();
740
- /*
741
- {
742
- "#carrier": "China Telecom",
743
- "#os": "iOS",
744
- "#device_id": "A8B1C00B-A6AC-4856-8538-0FBC642C1BAD",
745
- "#screen_height": 2264,
746
- "#bundle_id": "com.sw.thinkingdatademo",
747
- "#manufacturer": "Apple",
748
- "#device_model": "iPhone7",
749
- "#screen_width": 1080,
750
- "#system_language": "zh",
751
- "#os_version": "10",
752
- "#network_type": "WIFI",
753
- "#zone_offset": 8
754
- }
755
- */
756
-
757
- //Get a specific preset property
758
- String bundleId = presetProperties.bundleId;//package name
759
- String os = presetProperties.os;//os type, such as Android, iOS
760
- String systemLanguage = presetProperties.systemLanguage;//phone system language type
761
- int screenWidth = presetProperties.screenWidth;//screen width
762
- int screenHeight = presetProperties.screenHeight;//screen height
763
- String deviceModel = presetProperties.deviceModel;//device model
764
- String deviceId = presetProperties.deviceId;//device unique identifier
765
- String carrier = presetProperties.carrier;//phone SIM card carrier info, dual SIM dual standby, takes primary card's carrier info
766
- String manufacture = presetProperties.manufacturer;//phone manufacturer such as HuaWei, Apple
767
- String networkType = presetProperties.networkType;//network type
768
- String osVersion = presetProperties.osVersion;//system version number
769
- double zoneOffset = presetProperties.zoneOffset;//timezone offset value
770
- ```
771
-
772
- <!-- unsupported block: 34 -->
773
-
774
- IP, country and city information are generated from server-side parsing, client does not provide interface to get these properties
775
-
776
- ###