@thinkingai/ae-cli 6.1.37 → 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 (191) hide show
  1. package/README.md +3 -1
  2. package/README.zh.md +3 -1
  3. package/cli-installation-guide.md +1 -2
  4. package/dist/{ai-monitor-YKNYBHN2.js → ai-monitor-DST4NDOK.js} +5 -5
  5. package/dist/ai-monitor.js +7 -7
  6. package/dist/{auth-FXRGFG37.js → auth-BD3NIY3T.js} +3 -3
  7. package/dist/{automation-OQ647CSW.js → automation-IMDCJUML.js} +85 -9
  8. package/dist/{capability-GM7CH2LZ.js → capability-3NJOQHZQ.js} +3 -3
  9. package/dist/{chunk-46V4ZF7E.js → chunk-24DCOJBJ.js} +2 -2
  10. package/dist/{chunk-SHB7A2JE.js → chunk-2RORKIF6.js} +2 -2
  11. package/dist/{chunk-HBI7IQH3.js → chunk-6NJZSWUT.js} +3 -28
  12. package/dist/{chunk-QPUPWGZ3.js → chunk-DTODOQ6T.js} +1 -1
  13. package/dist/{chunk-EFGZFFSO.js → chunk-FRJUB66C.js} +1 -1
  14. package/dist/{chunk-OFOPYKYM.js → chunk-IY5G42YY.js} +2 -2
  15. package/dist/{chunk-NBXQSPXL.js → chunk-KBJHBVO7.js} +1 -1
  16. package/dist/{chunk-CYZV5AXW.js → chunk-KE5WGBXS.js} +2 -1
  17. package/dist/chunk-N2MAYIRU.js +32 -0
  18. package/dist/{chunk-IL2O4KDP.js → chunk-SQEK6S4X.js} +20 -21
  19. package/dist/{chunk-VPLRZSMY.js → chunk-STHIGWWC.js} +10 -1
  20. package/dist/{chunk-OTV5EBR5.js → chunk-TVSGS5QB.js} +5 -5
  21. package/dist/{chunk-LXRALNNA.js → chunk-UK7HQ4IL.js} +1 -1
  22. package/dist/{chunk-JFXDUX6U.js → chunk-VXKKTUU2.js} +2 -2
  23. package/dist/{chunk-E5CJI7L3.js → chunk-WRYXVIJP.js} +1 -1
  24. package/dist/{compat-check-ZMJWF6QG.js → compat-check-7VBBE7KO.js} +1 -1
  25. package/dist/{config-6G2LAH5D.js → config-LFRZBPH5.js} +4 -7
  26. package/dist/{context-Y2A6QIS3.js → context-WJQGJD6F.js} +1 -1
  27. package/dist/{data-integration-EIF5QHYF.js → data-integration-KMJWYAKK.js} +2 -1
  28. package/dist/index.js +34 -32
  29. package/dist/{memory-6QMZS4HF.js → memory-VPOPSU52.js} +3 -3
  30. package/dist/{metadata-6S3Z67JC.js → metadata-AR64J76Z.js} +5 -5
  31. package/dist/{model-LEYRQKOS.js → model-2F2354QP.js} +1 -1
  32. package/dist/{personal-semantic-preference-PKYS73D6.js → personal-semantic-preference-BCOSI4DO.js} +4 -4
  33. package/dist/{project-semantic-B5PG4JJB.js → project-semantic-DJLXAXLD.js} +4 -4
  34. package/dist/{sync-GB3IKG2D.js → sync-4TUIQ2PZ.js} +3 -3
  35. package/dist/{te-agent-S7UH657Z.js → te-agent-EMDWA3M6.js} +4 -4
  36. package/dist/{te-analysis-ZYL4AF34.js → te-analysis-XHAMRMTQ.js} +6 -6
  37. package/dist/{te-community-R63WXF6D.js → te-community-JSUSZEYH.js} +4 -4
  38. package/dist/{te-dataops-VHTPW433.js → te-dataops-I264BUTI.js} +2 -2
  39. package/dist/{te-engage-ZE7ROR3Z.js → te-engage-XNMQYO5N.js} +68 -16
  40. package/dist/{te-experiment-ZDR2JZTN.js → te-experiment-5SCHMYVO.js} +4 -4
  41. package/dist/{te-kb-6NXLBHE3.js → te-kb-QQ53TNRZ.js} +44 -13
  42. package/dist/{te-system-DB5Z3LLF.js → te-system-Z4VEB6PL.js} +1 -1
  43. package/dist/{te-team-KOSX43ZP.js → te-team-V6BBI52R.js} +87 -6
  44. package/dist/{things-G2QFXDK7.js → things-THHGDSEC.js} +4 -4
  45. package/dist/{update-XPNNE7UF.js → update-53ZUXWV5.js} +2 -2
  46. package/dist/{web-runtime-7DPC4HYJ.js → web-runtime-ZJHOIPKX.js} +4 -4
  47. package/dist/{workspace-RZESYB6T.js → workspace-W5ZPVWJS.js} +3 -3
  48. package/package.json +3 -3
  49. package/skills/ae-automation/SKILL.md +6 -2
  50. package/skills/ae-automation/references/cli.md +9 -3
  51. package/skills/ae-engage/SKILL.md +6 -1
  52. package/skills/ae-engage/references/common-metric.md +47 -1
  53. package/skills/ae-engage/references/flow-metric-update.md +1 -1
  54. package/skills/ae-engage/references/task-metric-update.md +1 -1
  55. package/skills/ae-experiment/SKILL.md +1 -1
  56. package/skills/ae-experiment/references/save_experiment.md +1 -1
  57. package/skills/ae-kb/SKILL.md +8 -6
  58. package/skills/ae-kb/references/query-workflow.md +5 -1
  59. package/skills/ae-onboarding/SKILL.md +2 -2
  60. package/skills/ae-onboarding/references/onboarding_run.md +1 -1
  61. package/skills/ae-team/SKILL.md +7 -3
  62. package/skills/ae-team/references/copy-to-personal.md +7 -0
  63. package/skills/ae-team/references/promote.md +7 -0
  64. package/skills/ae-team/references/update.md +3 -3
  65. package/skills/ae-tracking-matrix/SKILL.md +0 -170
  66. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  67. package/skills/ae-tracking-matrix/i18n.yaml +0 -12
  68. package/skills/ae-tracking-matrix/references/ae-capabilities.md +0 -93
  69. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +0 -30
  70. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +0 -256
  71. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +0 -213
  72. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +0 -407
  73. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +0 -218
  74. package/skills/ae-tracking-matrix/references/categories/casual_music.md +0 -112
  75. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +0 -301
  76. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +0 -356
  77. package/skills/ae-tracking-matrix/references/categories/fishing.md +0 -775
  78. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +0 -89
  79. package/skills/ae-tracking-matrix/references/categories/idle_card.md +0 -27
  80. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +0 -415
  81. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +0 -133
  82. package/skills/ae-tracking-matrix/references/categories/merge.md +0 -639
  83. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +0 -406
  84. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +0 -230
  85. package/skills/ae-tracking-matrix/references/categories/music.md +0 -137
  86. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +0 -414
  87. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +0 -199
  88. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +0 -158
  89. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +0 -546
  90. package/skills/ae-tracking-matrix/references/categories/rpg.md +0 -195
  91. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +0 -115
  92. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +0 -151
  93. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +0 -260
  94. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +0 -232
  95. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +0 -359
  96. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +0 -365
  97. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +0 -211
  98. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +0 -132
  99. package/skills/ae-tracking-matrix/references/category-registry.md +0 -77
  100. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +0 -230
  101. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +0 -406
  102. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +0 -128
  103. package/skills/ae-tracking-matrix/references/eval-cases.md +0 -74
  104. package/skills/ae-tracking-matrix/references/naming-dict.md +0 -238
  105. package/skills/ae-tracking-matrix/references/optimization-checklist.md +0 -85
  106. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +0 -142
  107. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +0 -47
  108. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +0 -794
  109. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +0 -94
  110. package/skills/ae-tracking-matrix/references/scene-routing.md +0 -80
  111. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +0 -3787
  112. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +0 -827
  113. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +0 -655
  114. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +0 -953
  115. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +0 -1128
  116. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +0 -714
  117. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +0 -1268
  118. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +0 -776
  119. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +0 -182
  120. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +0 -2755
  121. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +0 -1182
  122. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +0 -1300
  123. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +0 -1369
  124. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +0 -1692
  125. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +0 -902
  126. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +0 -763
  127. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +0 -1107
  128. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +0 -1532
  129. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +0 -845
  130. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +0 -228
  131. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +0 -149
  132. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +0 -407
  133. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +0 -163
  134. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +0 -149
  135. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +0 -153
  136. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +0 -232
  137. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +0 -314
  138. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +0 -117
  139. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +0 -148
  140. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +0 -645
  141. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +0 -307
  142. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +0 -347
  143. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +0 -72
  144. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +0 -264
  145. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +0 -566
  146. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +0 -409
  147. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +0 -446
  148. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +0 -557
  149. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +0 -457
  150. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +0 -490
  151. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +0 -523
  152. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +0 -484
  153. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +0 -442
  154. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +0 -391
  155. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +0 -91
  156. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +0 -635
  157. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +0 -113
  158. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +0 -466
  159. package/skills/ae-tracking-matrix/references/standard-base/README.md +0 -22
  160. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +0 -174
  161. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +0 -20
  162. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +0 -7
  163. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +0 -14
  164. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +0 -370
  165. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +0 -47
  166. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +0 -37
  167. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +0 -27
  168. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +0 -23
  169. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +0 -14
  170. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +0 -46
  171. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +0 -13
  172. package/skills/ae-tracking-matrix/references/system-fields.md +0 -297
  173. package/skills/ae-tracking-matrix/references/te-field-translations.md +0 -1791
  174. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +0 -232
  175. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +0 -829
  176. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +0 -355
  177. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +0 -283
  178. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +0 -168
  179. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +0 -205
  180. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +0 -75
  181. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +0 -36
  182. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +0 -107
  183. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +0 -114
  184. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +0 -53
  185. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +0 -166
  186. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +0 -674
  187. package/skills/ae-tracking-matrix/scripts/plan_contract.py +0 -200
  188. package/skills/ae-tracking-matrix/scripts/plan_types.py +0 -60
  189. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +0 -169
  190. package/skills/ae-tracking-matrix/scripts/sync_plan.py +0 -296
  191. package/skills/ae-tracking-matrix/scripts/upload_plan.py +0 -340
@@ -1,407 +0,0 @@
1
- # Environment Configuration
2
-
3
- Current documentation is written based on Java SDK v3.x new API, examples are oriented to technical developers, can be directly used as integration template reference. Deprecated: `cn.thinkingdata.tga.javasdk` package, `ThinkingDataAnalytics` / `LoggerConsumer` / `BatchConsumer` / `DebugConsumer` classes, and `user_set`, `user_add`, `track_first`, `track_update`, `track_overwrite` etc. snake_case methods. According to reference documentation changelog, as of 2026-01-07 latest release version is v3.0.4-beta.1; among them fastjson1, lzo, lz4 are no longer supported. For production environment please prioritize using verified fixed version, and complete regression verification before upgrading according to changelog.
4
-
5
- Java SDK minimum compatible with JDK 8. Common Java IDEs include **IntelliJ IDEA**, **Eclipse**, **NetBeans** etc., examples in this document use **IntelliJ IDEA**. To integrate SDK using Maven, add dependency in `pom.xml`. For latest version, please refer to official documentation or changelog:
6
-
7
- ```xml
8
- <dependencies>
9
- <!-- others... -->
10
- <dependency>
11
- <groupId>cn.thinkingdata</groupId>
12
- <artifactId>thinkingdatasdk</artifactId>
13
- <version>3.0.2</version>
14
- </dependency>
15
- </dependencies>
16
- ```
17
-
18
- #### TDLoggerConsumer Example Code
19
-
20
- ```java
21
- import cn.thinkingdata.analytics.TDAnalytics;
22
- import cn.thinkingdata.analytics.TDLoggerConsumer;
23
-
24
- import java.util.ArrayList;
25
- import java.util.Date;
26
- import java.util.HashMap;
27
- import java.util.List;
28
- import java.util.Map;
29
-
30
- public class LoggerExample {
31
- public static void main(String[] args) {
32
- TDAnalytics ta = null;
33
- try {
34
- // Initialize SDK, LOG_DIRECTORY is local log directory
35
- ta = new TDAnalytics(new TDLoggerConsumer("LOG_DIRECTORY"), true);
36
-
37
- Map<String, Object> properties = new HashMap<>();
38
- properties.put("#ip", "192.168.1.1");
39
- properties.put("channel", "te");
40
- properties.put("age", 1);
41
- properties.put("is_success", true);
42
- properties.put("birthday", new Date());
43
-
44
- Map<String, Object> object = new HashMap<>();
45
- object.put("key", "value");
46
- properties.put("object", object);
47
-
48
- List<Map<String, Object>> objectArray = new ArrayList<>();
49
- objectArray.add(object);
50
- properties.put("object_arr", objectArray);
51
-
52
- List<String> tags = new ArrayList<>();
53
- tags.add("value");
54
- properties.put("arr_string", tags);
55
-
56
- ta.track("account_id", "distinct_id", "payment", properties);
57
-
58
- Map<String, Object> userProperties = new HashMap<>();
59
- userProperties.put("user_name", "TE");
60
- ta.userSet("account_id", "distinct_id", userProperties);
61
-
62
- // Only call when immediate flush is needed, avoid high frequency flush causing extra IO overhead
63
- ta.flush();
64
- } catch (Exception e) {
65
- e.printStackTrace();
66
- } finally {
67
- if (ta != null) {
68
- try {
69
- ta.close();
70
- } catch (Exception e) {
71
- e.printStackTrace();
72
- }
73
- }
74
- }
75
- }
76
- }
77
- ```
78
-
79
- #### TDBatchConsumer Example Code
80
-
81
- ```java
82
- import cn.thinkingdata.analytics.TDAnalytics;
83
- import cn.thinkingdata.analytics.TDBatchConsumer;
84
-
85
- import java.util.Date;
86
- import java.util.HashMap;
87
- import java.util.Map;
88
-
89
- public class BatchExample {
90
- public static void main(String[] args) {
91
- TDAnalytics ta = null;
92
- try {
93
- ta = new TDAnalytics(new TDBatchConsumer("SERVER_URL", "APP_ID"));
94
-
95
- String distinctId = "ABCDEFG123456789";
96
- String accountId = "TA_10001";
97
-
98
- Map<String, Object> properties = new HashMap<>();
99
- properties.put("#time", new Date());
100
- properties.put("#ip", "192.168.1.1");
101
- properties.put("product_name", "Product A");
102
- properties.put("price", 30);
103
- properties.put("order_id", "abc_123");
104
-
105
- ta.track(accountId, distinctId, "payment", properties);
106
-
107
- // Batch mode usually relies on batch threshold or timing mechanism to trigger sending
108
- ta.flush();
109
- } catch (Exception e) {
110
- e.printStackTrace();
111
- } finally {
112
- if (ta != null) {
113
- try {
114
- ta.close();
115
- } catch (Exception e) {
116
- e.printStackTrace();
117
- }
118
- }
119
- }
120
- }
121
- }
122
- ```
123
-
124
- #### TDDebugConsumer Example Code
125
-
126
- ```java
127
- import cn.thinkingdata.analytics.TDAnalytics;
128
- import cn.thinkingdata.analytics.TDDebugConsumer;
129
-
130
- import java.util.HashMap;
131
- import java.util.Map;
132
-
133
- public class DebugExample {
134
- public static void main(String[] args) {
135
- TDAnalytics ta = null;
136
- try {
137
- TDAnalytics.enableLog(true);
138
- ta = new TDAnalytics(new TDDebugConsumer("SERVER_URL", "APP_ID", "DEBUG_DEVICE_ID"));
139
-
140
- Map<String, Object> properties = new HashMap<>();
141
- properties.put("product_name", "shoes");
142
- properties.put("price", 199);
143
-
144
- ta.track("account_id", "distinct_id", "payment", properties);
145
- } catch (Exception e) {
146
- e.printStackTrace();
147
- } finally {
148
- if (ta != null) {
149
- try {
150
- ta.close();
151
- } catch (Exception e) {
152
- e.printStackTrace();
153
- }
154
- }
155
- }
156
- }
157
- }
158
- ```
159
-
160
- > Enabling Debug mode requires two steps:
161
- >
162
- > 1. Use `TDDebugConsumer` in code and pass `DEBUG_DEVICE_ID`.
163
- > 2. Configure the same Debug device ID in TE backend "Data > Tracking Management > Debug Data". Only configured devices can truly enable Debug mode.
164
-
165
- # Working Principles
166
-
167
- #### **What working modes does Java SDK support? What scenarios are they suitable for?**
168
-
169
- Java SDK v3.x common three working modes:
170
-
171
- 1. **TDLoggerConsumer**: Writes data in batches to local logs, then transmitted by LogBus. Suitable for production environment, scenarios requiring higher recoverability and more secure data loss control, also officially recommended server-side integration solution.
172
- 2. **TDBatchConsumer**: Directly sends data in batches to TA server, simple integration, but cache is only stored in memory. Suitable for medium-small traffic, stable network quality, scenarios accepting certain retry and cache limit constraints.
173
- 3. **TDDebugConsumer**: Sends one by one with strict validation, convenient for integration verification and real-time debugging. Only recommended for development debugging phase, strictly forbidden for production environment.
174
-
175
- #### **How to get upload address and APP_ID?**
176
-
177
- Project manager can select specific project on ThinkingData Web interface, then enter "Project Management > Project Configuration > Integration Configuration" to get APP_ID and data upload address. Upload address is usually divided into public network address and private network address:
178
-
179
- - Public network address: Suitable for client upload, and server-side integration in public network environment.
180
- - Private network address: Suitable for data integration and testing in internal network environment. If using private deployment, recommended to bind domain for data integration address and configure HTTPS certificate; if using cloud service, please directly use platform provided integration address.
181
-
182
- #### **What is LoggerConsumer's working principle? What configuration parameters does it have?**
183
-
184
- v3.x implementation is `TDLoggerConsumer`. Events first write to memory cache, flush to local log file after reaching threshold; if auto-flush is enabled, also flush at fixed time interval. This mode is thread-safe, but single instance call defaults to synchronous; if multiple threads frequently compete for same instance, throughput improvement is usually limited. In production environment recommended to use with LogBus, decoupling "flush to disk" and "upload".
185
-
186
- `TDLoggerConsumer.Config` common parameters:
187
-
188
- | Parameter | Description | Default | Value Range | Note |
189
- | ---------------- | ---------------------------- | ------- | ----------------- | ----------------------------------------------------- |
190
- | `logDirectory` | Log file write directory | None | String | Multi-level directories auto-created |
191
- | `rotateMode` | Log rotation mode | `DAILY` | `HOURLY`, `DAILY` | By hour or by day |
192
- | `lockFileName` | File lock name | None | String | Not recommended to enable without clear need |
193
- | `filenamePrefix` | Log filename prefix | None | String | For multi-instance or multi-business file distinction |
194
- | `interval` | Auto flush interval | `3` | Integer | Used with `autoFlush`, unit seconds |
195
- | `fileSize` | File size rotation threshold | `0` | Integer | Unit MB, `0` means no size rotation |
196
- | `bufferSize` | Memory buffer size | `8192` | Integer | Unit bytes |
197
- | `autoFlush` | Whether auto flush | `false` | Boolean | Only enable when real-time requirement exists |
198
-
199
- #### **What is BatchConsumer's working principle? What configuration parameters does it have?**
200
-
201
- v3.x implementation is `TDBatchConsumer`. Events first write to memory queue, send to server when batch threshold met or `flush()` triggered; failed network sends enter retry and cache logic. Its advantage is simple integration, no LogBus dependency; disadvantage is cache only exists in memory, service abnormal exit or long network issues may cause data loss, therefore not recommended as first choice for high reliability production solution.
202
-
203
- `TDBatchConsumer.Config` common parameters:
204
-
205
- | Parameter | Description | Default | Value Range | Note |
206
- | ------------------ | --------------------------------------- | ------- | -------------- | --------------------------------------------------------------- |
207
- | `batchSize` | Single batch send count threshold | `20` | Integer | Triggers send after reaching threshold |
208
- | `interval` | Auto send interval | `3` | Integer | Used with `autoFlush`, unit seconds |
209
- | `compress` | Data compression format | `gzip` | `gzip`, `none` | `lzo`, `lz4` no longer supported in new version |
210
- | `timeout` | Network request timeout | `30000` | Integer | Unit milliseconds |
211
- | `autoFlush` | Whether auto send | `false` | Boolean | Enable based on business real-time requirement |
212
- | `maxCacheSize` | Failed batch cache limit | `50` | Integer | Default max cache `20 * 50` records |
213
- | `isThrowException` | Whether throw exception on send failure | `true` | Boolean | Recommended to keep default, for business side to perceive risk |
214
-
215
- #### **What is DebugConsumer's working principle? What configuration parameters does it have?**
216
-
217
- Old `DebugConsumer` is deprecated, v3.x implementation is `TDDebugConsumer`. This mode sends data one by one via HTTP request, and performs strict validation on server; suitable for integration phase quick identification of field format, event naming and data validity issues.
218
-
219
- `TDDebugConsumer` common parameters:
220
-
221
- | Parameter | Description | Default | Value Range | Note |
222
- | ----------- | ------------------------ | ------- | ----------- | -------------------------------------------- |
223
- | `serverUrl` | Data integration address | None | String | Must match project configuration |
224
- | `appId` | Project APP_ID | None | String | Can get from project configuration page |
225
- | `deviceId` | Debug device ID | None | String | Must configure as Debug device in TE backend |
226
-
227
- Recommended to enable SDK log during debugging:
228
-
229
- ```java
230
- TDAnalytics.enableLog(true);
231
- ```
232
-
233
- # Common Issues
234
-
235
- #### **What are the precautions for using LoggerConsumer?**
236
-
237
- - **Use with LogBus Upload**
238
- - `TDLoggerConsumer + LogBus` is the more recommended server-side integration combination, ensures local persistence, also reduces application process directly bearing transmission pressure.
239
- - **File Write Permission**
240
- - Log directory needs stable read-write permission, Windows or container environment especially needs advance verification of directory permission and mount strategy.
241
- - **Disk Space**
242
- - Production environment needs continuous monitoring of log directory remaining capacity, configure retention and deletion rules in LogBus or external cleanup strategy.
243
- - **Disk Performance and NFS**
244
- - If log directory is on NFS etc. network file system, need to evaluate write latency, throughput and network jitter impact.
245
- - **Deduplication Identifier**
246
- - Recommended to add idempotent control field, reduce duplicate data risk in extreme network scenarios.
247
- - **Multi-process Write Strategy**
248
- - Can have multiple processes write different files or directories, but don't let multiple processes write same log file.
249
- - **Container Environment**
250
- - Recommended to map log directory to container external persistent storage, avoid data loss after container destruction.
251
-
252
- #### **Does LoggerConsumer support multi-threading? Does it support multi-process?**
253
-
254
- Supports multi-threading. SDK's related write and flush logic has thread-safe guarantee, but single instance defaults to synchronous call model, multi-threading sharing same instance may not significantly improve throughput. Does not support multiple processes writing same file. If multiple processes simultaneously write same log file, may trigger `OverlappingFileLockException`. Correct approach is to have different processes write different files or directories.
255
-
256
- #### **What are LoggerConsumer performance metrics?**
257
-
258
- For specific performance test report please see Server-Java-sdk Performance Test Report.
259
-
260
- #### **Does LoggerConsumer have data loss risk? How to avoid?**
261
-
262
- If disk is full, host machine abnormal shutdown, log not timely flushed, or log directory unavailable, data loss risk still exists. Recommendations:
263
-
264
- 1. Regularly check log directory disk capacity and inode usage.
265
- 2. Reasonably adjust `bufferSize` and `autoFlush` based on business real-time requirement, don't blindly pursue large cache.
266
- 3. Ensure call `close()` before program exit, give SDK time to flush to disk.
267
- 4. In container or elastic environment, put log directory to persistent storage.
268
-
269
- #### **Why does BatchConsumer have data loss risk? How to avoid?**
270
-
271
- `TDBatchConsumer` maintains pending send queue and failed retry cache based on memory. As long as data hasn't successfully sent to server, risk of loss from process exit, memory overflow, long network abnormality or cache limit being filled still exists. Recommendations:
272
-
273
- 1. Production environment prioritize using `TDLoggerConsumer + LogBus`.
274
- 2. Reasonably increase `maxCacheSize` based on network quality and traffic scale, but also evaluate memory usage.
275
- 3. Don't set `batchSize` too large, to avoid single batch send time too long, retry cost too high.
276
- 4. Enable `autoFlush` when needing to reduce memory residence time.
277
- 5. Handle `NeedRetryException` at business level, rather than simply swallowing exception.
278
-
279
- #### **What are BatchConsumer performance metrics? What scenarios is it suitable for?**
280
-
281
- For specific performance test report please see Server-Java-sdk Performance Test Report. `TDBatchConsumer` is more suitable for medium-small data volume, stable network, simple integration priority scenarios accepting memory cache limitations; if you need higher reliability, still recommend prioritizing evaluation of `TDLoggerConsumer + LogBus`.
282
-
283
- #### **Why is DebugConsumer forbidden in production environment?**
284
-
285
- Because Debug mode sends one by one with strict validation, each request adds extra network and validation overhead, throughput and stability are not suitable as production pipeline.
286
-
287
- #### **When to call `close()` method?**
288
-
289
- Call when application is preparing normal exit. `close()` will attempt to continue flushing cached data or sending, is necessary step to avoid tail data loss. Recommended to execute uniformly in application lifecycle shutdown hook.
290
-
291
- #### **Called `track()` or `userSet()` method in program, why no data visible in TE backend?**
292
-
293
- Please check the following situations in order:
294
-
295
- - **Check upload address and APP_ID**
296
- - `curl https://push_url/health-check`, return `ok` means integration address reachable.
297
- - `curl https://push_url/check_appid?appid=targetAPPID`, return `{"code":0}` means integration address and APP_ID match.
298
- - **Too few data, not triggered write or send**
299
- - `TDLoggerConsumer` and `TDBatchConsumer` both depend on cache threshold, auto-flush or manual `flush()` to actually flush to disk/upload.
300
- - `flush()` can be used for troubleshooting, but not recommended for high frequency call in production code.
301
- - **Error Data**
302
- - Can view error data reason in Web interface.
303
- - **Data Time**
304
- - Server data receive time range upper limit is from 3 years before server time to 3 days after.
305
- - Client data receive time range upper limit is from 10 days before server time to 3 days after.
306
- - **Historical Channel**
307
- - If project enabled historical channel, when uploading historical data 10 days ago, need to confirm if correctly entered historical channel pipeline.
308
- - **Tracking Plan**
309
- - If project enabled tracking plan, and set "Events not in tracking plan: not allowed to store", events not in plan will be directly blocked.
310
- - **Whitelist**
311
- - If project configured IP whitelist, need to confirm current upload source IP is in whitelist; whitelist effect usually has brief delay.
312
-
313
- #### **Why is #ip missing in uploaded data?**
314
-
315
- Please prioritize checking the following:
316
-
317
- - Whether `#ip` is explicitly written into event properties.
318
- - Whether `#ip` value is valid IP.
319
- - Whether currently mistakenly using old version custom wrapper from historical code. For v3.x SDK, recommended to directly write `#ip` into event properties `Map<String, Object>` per official example, don't continue using old version manual assembly message approach.
320
-
321
- # Preset Properties, Special Type Upload
322
-
323
- #### **How to upload Object and Object Group types with Java SDK?**
324
-
325
- Java SDK 1.9.0 and above support Object and Object Group types. In v3.x can continue using Object and `List<Map<String, Object>>` way to organize properties, complex type examples can refer to Server SDK Complex Type Upload.
326
-
327
- #### **If a property is first uploaded as null value, how to upload?**
328
-
329
- Object Group:
330
-
331
- ```java
332
- Map<String, Object> properties = new HashMap<>();
333
-
334
- List<Map<String, Object>> arrayRowTest = new ArrayList<>();
335
- // Put at least one empty object, avoid being recognized as normal list type
336
- arrayRowTest.add(new HashMap<>());
337
-
338
- properties.put("array_row_test", arrayRowTest);
339
- // Upload logic...
340
- ```
341
-
342
- List:
343
-
344
- ```java
345
- Map<String, Object> properties = new HashMap<>();
346
-
347
- List<String> arrayTest = new ArrayList<>();
348
- properties.put("array_test", arrayTest);
349
- // Upload logic...
350
- ```
351
-
352
- Object, Number, Text, Time, Boolean type properties don't support directly uploading `null`. If field currently has no value, don't pass that property, let result remain empty in data table.
353
-
354
- #### **Common Properties**
355
-
356
- Server-side common properties cannot be precise to user level. In multi-threading or concurrent request scenarios, if putting user-level fields into common properties,is prone to user dimension mismatch. Recommended to only put stable and globally consistent fields in common properties, such as server ID, deployment environment, service node identifier etc.; user-level, request-level, event-level fields should be directly put in current event properties.
357
-
358
- #### **Timezone**
359
-
360
- If event time is not UTC+8, and want to preserve original timezone offset information, can add `#zone_offset` field in normal properties. For example event time is UTC+0, can set `#zone_offset` to numeric value `0`.
361
-
362
- #### **Updatable Events**
363
-
364
- In cluster environment, if updatable events have millisecond-level concurrent updates, may appear out-of-order consumption, causing final result not matching expectation. When encountering such scenarios, recommended to add a sorting normal property in event properties, such as `order`, and set transaction property in event, let server decide whether to overwrite in order. Example:
365
-
366
- ```java
367
- Map<String, Object> properties = new HashMap<>();
368
- properties.put("status", 2);
369
- properties.put("order", 1);
370
- properties.put("#transaction_property", "order");
371
-
372
- ta.trackUpdate("account_id", "distinct_id", "order_status_changed", "event_id_1", properties);
373
- ```
374
-
375
- # Exception Errors
376
-
377
- #### **Multi-process file write OverlappingFileLockException exception, how to handle?**
378
-
379
- `TDLoggerConsumer` doesn't support multiple processes writing same file. When this exception occurs, should adjust to "multi-process write different files" or "multi-process write different directories", don't hard retry.
380
-
381
- #### **track() throws exception "exception : cn.thinkingdata.tga.javasdk.exception.InvalidArgumentException: The supported data type including: Number, String, Date, Boolean,List. Invalid property: xxx", how to handle?**
382
-
383
- If exception class name still comes from `cn.thinkingdata.tga.javasdk.exception`, means current project still using old SDK or old API. Recommended to directly upgrade to v3.x, and uniformly replace with new package name `cn.thinkingdata.analytics` and camelCase methods. Also check property value typewhether it meets requirements. Supported common types include String, Number, Boolean, Time, Object, Object Group and Array; unsupported types should be converted at business side before uploading.
384
-
385
- #### **How to handle NeedRetryException?**
386
-
387
- When SDK continuously retry fails when sending data, may throw `NeedRetryException`. This usually means network pipeline, server reachability or integration configuration has issues. Recommendations:
388
-
389
- 1. Record exception and print key information, don't directly swallow.
390
- 2. Combine monitoring to judge if brief network jitter or continuous failure.
391
- 3. During continuous exception, prioritize pausing high frequency upload or switching to more secure pipeline, avoid cache continuously filling.
392
- 4. After failure recovery, gradually resume business traffic.
393
-
394
- #### **Can BatchConsumer get failed uploaded data?**
395
-
396
- SDK itself won't directly expose a "failed data list" for business side to read. Failed batches are usually handled by internal cache and retry mechanism, after exceeding cache limit will be discarded. Therefore if you have high requirement for failure traceability, should prioritize using flush to disk solution, rather than relying on memory cache.
397
-
398
- #### **Using thread pool for upload found thread queue accumulation, thread pool blocked, what reason? How to handle?**
399
-
400
- If multiple threads frequently share same `TDAnalytics` instance for upload, internal synchronization control will keep send order consistent with call order, but also bring blocking and accumulation. Handling methods usually have two:
401
-
402
- 1. If different threads have no strict order dependency, can split multiple SDK instances by thread or by shard.
403
- 2. If scenario focuses more on stability and peak shaving capability, can switch to `TDLoggerConsumer + LogBus`.
404
-
405
- #### **NullPointerException when calling data upload interface (track, userSet, etc.)**
406
-
407
- Please carefully check passed property `Map` whether contains `null` key or `null` value. Business code should filter null values before assembling properties; for fields "without value", directly don't pass, don't explicitly put `null`.
@@ -1,163 +0,0 @@
1
- ---
2
- title: "JavaScript SDK FAQ"
3
- code: "javascript_sdk_faq"
4
- source: "Feishu MCP"
5
- doc_id: "FVlZw0Q3wig1svk13CEcGlQonHd"
6
- fetched_at: "2026-04-20T17:29:40Z"
7
- ---
8
-
9
- # Integrate & Initialize SDK
10
-
11
- ## SDK Integration Methods
12
-
13
- ### Automatic Integration (npm)
14
-
15
- ```shell
16
- npm install thinkingdata-browser --save
17
- ```
18
-
19
- ### Manual Integration
20
-
21
- - Synchronous loading or asynchronous loading
22
-
23
- ## SDK Compatibility Notes
24
-
25
- - Runtime environment must be browser, currently not compatible with IE 8 and below
26
-
27
- # SDK Data Upload Strategy
28
-
29
- ## Network Request Method Parameter (send_method)
30
-
31
- | Method | Request Type | Description |
32
- | ------ | ------------ | ------------------------------------------------------- |
33
- | image | get | Data appended to image request, cross-origin compatible |
34
- | ajax | post | Uses XMLHttpRequest, can send large amounts of data |
35
- | beacon | post | Browser background sending, does not block page unload |
36
-
37
- ## Immediate Upload
38
-
39
- - Normal mode without batch upload enabled uploads immediately
40
- - debug or debugOnly mode uploads immediately
41
- - Manually calling flush() interface
42
-
43
- ## Batch Upload
44
-
45
- ```javascript
46
- var config = {
47
- appId: "APP_ID",
48
- serverUrl: "SERVER_URL",
49
- send_method: "ajax",
50
- batch: {
51
- size: 5,
52
- interval: 5000,
53
- maxLimit: 200,
54
- },
55
- };
56
- ```
57
-
58
- # SDK Cache Mechanism
59
-
60
- ## Storage Content
61
-
62
- - Visitor ID, Device ID, event data, etc.
63
- - Uses localStorage for storage
64
-
65
- ## Cache Count Limit
66
-
67
- - Default maximum cache of 500 records
68
-
69
- # Visitor ID (#distinct_id)
70
-
71
- ## Default Format
72
-
73
- - Timestamp16hex-Random16hex-UA16hex-ScreenWidthHeight-Timestamp16hex
74
-
75
- ## Manual Setting
76
-
77
- ```javascript
78
- ta.identify("your_distinct_id");
79
- ```
80
-
81
- ## Length Limit
82
-
83
- - Maximum length 128 characters
84
-
85
- # Debug Mode
86
-
87
- ## mode Three Values
88
-
89
- - normal: Normal mode
90
- - debug: Data visible in TE Debug mode
91
- - debug_only: Only validation, not stored in database
92
-
93
- # Auto-tracking
94
-
95
- ## ta_page_show
96
-
97
- - Triggered when page opens, refreshes, tab switches back to current page
98
- - Monitors visibilitychange event, document.hidden = false
99
-
100
- ## ta_page_hide
101
-
102
- - Triggered when page closes, tab switches, minimize
103
- - Monitors visibilitychange event, document.hidden = true
104
-
105
- ## ta_pageview
106
-
107
- - Requires calling quick() method for manual upload
108
- - Difference from ta_page_show: ta_page_show is auto-tracked, ta_pageview requires manual call
109
-
110
- # Common Event Properties
111
-
112
- ## Static Common Event Properties
113
-
114
- ```javascript
115
- ta.setSuperProperties({ channel: "Channel Name", user_name: "User Name" });
116
- ```
117
-
118
- ## Dynamic Common Event Properties
119
-
120
- ```javascript
121
- ta.setDynamicSuperProperties(function () {
122
- return { gold_coin: getGold() };
123
- });
124
- ```
125
-
126
- ## Page Common Properties
127
-
128
- ```javascript
129
- ta.setPageProperty({ page_id: "page10001" });
130
- ```
131
-
132
- ## Property Priority
133
-
134
- - User-defined > Page common > Dynamic common > Static common
135
-
136
- # Preset Properties
137
-
138
- ## Device ID (#device_id)
139
-
140
- - Default same as Visitor ID
141
-
142
- ## IP Address (#ip)
143
-
144
- - Server resolves from request header
145
- - Can manually upload #ip
146
-
147
- # Common Issues
148
-
149
- ## Error Cannot read properties of undefined (reading 'getOptTracking')
150
-
151
- - SDK interface called before initialization, needs to be called after initialization
152
-
153
- ## Error net::ERR_BLOCKED_BY_ORB
154
-
155
- - Default uses image mode upload, can set imgUseCrossorigin: true
156
-
157
- ## How to Upload Data in pagehide
158
-
159
- - Use trackWithBeacon method
160
-
161
- # Known Issues
162
-
163
- See complete documentation for details.