@thinkingai/ae-cli 6.1.30 → 6.1.32

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 (261) hide show
  1. package/README.md +11 -5
  2. package/README.zh.md +11 -5
  3. package/bin/ai-monitor.js +2 -0
  4. package/dist/ai-monitor-MKMHSSNI.js +32 -0
  5. package/dist/ai-monitor.js +135 -0
  6. package/dist/{auth-ADZHUIJR.js → auth-CZHHPZOQ.js} +10 -9
  7. package/dist/{automation-FD2QZUP6.js → automation-FLCPFMN4.js} +4 -4
  8. package/dist/{capability-QXFRJYZD.js → capability-64KVJFIA.js} +27 -31
  9. package/dist/{chunk-YULUBP3R.js → chunk-3ULDJJTZ.js} +1 -1
  10. package/dist/{chunk-HRUOV6EQ.js → chunk-4XKTRCRK.js} +15 -15
  11. package/dist/{chunk-JSBLCLFE.js → chunk-5M5LBRR3.js} +1 -1
  12. package/dist/chunk-6M7ZEDT2.js +182 -0
  13. package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
  14. package/dist/chunk-BNBCMCYN.js +563 -0
  15. package/dist/chunk-CF6JTT2U.js +64 -0
  16. package/dist/{chunk-CG773QXN.js → chunk-DWBYNGSR.js} +564 -314
  17. package/dist/{chunk-VDICGXCY.js → chunk-F2VFZUGG.js} +2 -2
  18. package/dist/{chunk-TFORY6WY.js → chunk-FCAA7I2D.js} +2 -2
  19. package/dist/{chunk-SOSFRU3O.js → chunk-HTZ2MLYA.js} +47 -21
  20. package/dist/{chunk-AWVZTN2B.js → chunk-HVMCPKOZ.js} +1 -1
  21. package/dist/chunk-IDDWEZ7F.js +1285 -0
  22. package/dist/{chunk-E25OSZLJ.js → chunk-KTJXD27G.js} +2 -2
  23. package/dist/{chunk-AVXDJAFC.js → chunk-NLEXY2TM.js} +47 -12
  24. package/dist/{chunk-YVG6QD3V.js → chunk-P7QDCWJ6.js} +98 -7
  25. package/dist/{chunk-EUFP4M2A.js → chunk-T7WF4HYW.js} +84 -32
  26. package/dist/{chunk-Y3AM6LIO.js → chunk-TMQGS4TO.js} +15 -10
  27. package/dist/{compat-check-HERBTQZN.js → compat-check-ZJNCMNQV.js} +2 -2
  28. package/dist/{config-E3KANXMK.js → config-FSH2NMNZ.js} +25 -12
  29. package/dist/{context-CDB5H5PD.js → context-YAQG6YQC.js} +2 -2
  30. package/dist/{evaluation-LR4YDYWL.js → evaluation-2JSF4V47.js} +13 -158
  31. package/dist/index.js +81 -583
  32. package/dist/{memory-SNFR5M23.js → memory-VEZZVAAP.js} +4 -4
  33. package/dist/{metadata-EXQYDZTH.js → metadata-3IWHX3V4.js} +7 -7
  34. package/dist/{model-KEVCEXWD.js → model-T7H7Q6BG.js} +2 -2
  35. package/dist/{personal-semantic-preference-ETY3KU2O.js → personal-semantic-preference-YITU23SA.js} +6 -6
  36. package/dist/{project-semantic-UHRMVOJF.js → project-semantic-MHEXJF3C.js} +15 -13
  37. package/dist/{sync-XKEBXESC.js → sync-AQHVCSPI.js} +4 -4
  38. package/dist/{te-agent-S6UQR4IE.js → te-agent-RXI7WOH4.js} +5 -5
  39. package/dist/{te-analysis-WOFFCIBC.js → te-analysis-CZY74HVF.js} +380 -191
  40. package/dist/{te-community-R7B6QYOO.js → te-community-DKCYUBCM.js} +6 -6
  41. package/dist/{te-dataops-KPILYVHA.js → te-dataops-QEH6VE56.js} +3 -3
  42. package/dist/{te-engage-IAUM6ONX.js → te-engage-WK7WKDKF.js} +6 -6
  43. package/dist/{te-experiment-TMLRA7B3.js → te-experiment-LH3RPIOE.js} +274 -29
  44. package/dist/{te-kb-GKWPSLSY.js → te-kb-UPORIOVN.js} +16 -7
  45. package/dist/{te-system-CYWSK3UN.js → te-system-AL4B4XZL.js} +2 -2
  46. package/dist/{te-team-ISN52YNG.js → te-team-LLVTO2G4.js} +5 -5
  47. package/dist/{things-DDQ52Z3Q.js → things-XLMLBYQR.js} +5 -5
  48. package/dist/{update-CTLNTX35.js → update-7J5UQHSK.js} +3 -3
  49. package/dist/{workspace-2CKQX2XL.js → workspace-FF2HXJGR.js} +4 -4
  50. package/package.json +9 -7
  51. package/skills/ae-ai-monitor/SKILL.md +179 -0
  52. package/skills/ae-ai-monitor/references/read-commands.md +866 -0
  53. package/skills/ae-analysis/SKILL.md +10 -4
  54. package/skills/ae-analysis/references/adhoc_export.md +3 -1
  55. package/skills/ae-analysis/references/ai_models/path.md +5 -6
  56. package/skills/ae-analysis/references/ai_models.md +1 -0
  57. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
  58. package/skills/ae-analysis/references/asset_search.md +1 -1
  59. package/skills/ae-analysis/references/bad_case_begin.md +12 -0
  60. package/skills/ae-analysis/references/bad_case_get.md +12 -0
  61. package/skills/ae-analysis/references/bad_case_history.md +12 -0
  62. package/skills/ae-analysis/references/bad_case_list.md +12 -0
  63. package/skills/ae-analysis/references/bad_case_review.md +51 -0
  64. package/skills/ae-analysis/references/bad_case_run.md +12 -0
  65. package/skills/ae-analysis/references/bad_case_submit.md +12 -0
  66. package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
  67. package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
  68. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  69. package/skills/ae-analysis/references/bi_panel_share.md +3 -1
  70. package/skills/ae-analysis/references/catalog_list.md +2 -0
  71. package/skills/ae-analysis/references/command_index.md +38 -29
  72. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  73. package/skills/ae-analysis/references/dashboard_handover.md +3 -1
  74. package/skills/ae-analysis/references/dashboard_list.md +3 -3
  75. package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
  76. package/skills/ae-analysis/references/dashboard_share.md +3 -1
  77. package/skills/ae-analysis/references/dashboard_update.md +3 -2
  78. package/skills/ae-analysis/references/filter_value_list.md +2 -0
  79. package/skills/ae-analysis/references/folder_share.md +8 -2
  80. package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
  81. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
  82. package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
  83. package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
  84. package/skills/ae-analysis/references/project_member_add.md +3 -1
  85. package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
  86. package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
  87. package/skills/ae-analysis/references/project_member_update.md +3 -1
  88. package/skills/ae-analysis/references/project_owner_update.md +3 -1
  89. package/skills/ae-analysis/references/project_role_upsert.md +5 -3
  90. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
  91. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
  92. package/skills/ae-analysis/references/project_space_share.md +8 -2
  93. package/skills/ae-analysis/references/property_get.md +2 -0
  94. package/skills/ae-analysis/references/public_link_list.md +3 -1
  95. package/skills/ae-analysis/references/query_cancel.md +4 -1
  96. package/skills/ae-analysis/references/report_data_run.md +1 -1
  97. package/skills/ae-analysis/references/report_list.md +3 -3
  98. package/skills/ae-analysis/references/scenario_append.md +2 -2
  99. package/skills/ae-analysis/references/scenario_collect.md +15 -4
  100. package/skills/ae-analysis/references/scenario_list.md +2 -1
  101. package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
  102. package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
  103. package/skills/ae-analysis/references/user_tag_create.md +4 -1
  104. package/skills/ae-analysis/references/user_tag_get.md +2 -0
  105. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  106. package/skills/ae-analysis/references/user_tag_update.md +5 -2
  107. package/skills/ae-analysis/references/virtual_property_create.md +12 -1
  108. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
  109. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
  110. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
  111. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
  112. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
  113. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
  114. package/skills/ae-automation/SKILL.md +4 -2
  115. package/skills/ae-capability/SKILL.md +9 -5
  116. package/skills/ae-community/SKILL.md +1 -0
  117. package/skills/ae-dataops/SKILL.md +1 -0
  118. package/skills/ae-engage/SKILL.md +1 -0
  119. package/skills/ae-evaluation/SKILL.md +17 -2
  120. package/skills/ae-experiment/SKILL.md +38 -11
  121. package/skills/ae-experiment/references/experiment_approval.md +171 -0
  122. package/skills/ae-experiment/references/manage_experiment.md +11 -2
  123. package/skills/ae-experiment/references/save_experiment.md +28 -8
  124. package/skills/ae-experiment/references/save_submit_experiment.md +18 -3
  125. package/skills/ae-experiment/references/save_submit_external_experiment.md +57 -3
  126. package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
  127. package/skills/ae-kb/SKILL.md +5 -3
  128. package/skills/ae-kb/references/analysis-workflow.md +11 -2
  129. package/skills/ae-kb/references/query-workflow.md +3 -1
  130. package/skills/ae-kb/references/versions.md +1 -1
  131. package/skills/ae-metadata/SKILL.md +1 -0
  132. package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
  133. package/skills/ae-team/SKILL.md +1 -1
  134. package/skills/ae-tracking-matrix/SKILL.md +170 -0
  135. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  136. package/skills/ae-tracking-matrix/i18n.yaml +12 -0
  137. package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
  138. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
  139. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
  140. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
  141. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
  142. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
  143. package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
  144. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
  145. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
  146. package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
  147. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
  148. package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
  149. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
  150. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
  151. package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
  152. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
  153. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
  154. package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
  155. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
  156. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
  157. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
  158. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
  159. package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
  160. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
  161. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
  162. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
  163. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
  164. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
  165. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
  166. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
  167. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
  168. package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
  169. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
  170. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
  171. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
  172. package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
  173. package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
  174. package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
  175. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
  176. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
  177. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
  178. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
  179. package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
  180. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
  181. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
  182. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
  183. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
  184. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
  185. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
  186. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
  187. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
  188. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
  189. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
  190. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
  191. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
  192. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
  193. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
  194. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
  195. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
  196. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
  197. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
  198. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
  199. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
  200. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
  201. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
  202. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
  203. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
  204. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
  205. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
  206. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
  207. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
  208. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
  209. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
  210. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
  211. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
  212. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
  213. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
  214. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
  215. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
  216. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
  217. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
  218. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
  219. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
  220. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
  221. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
  222. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
  223. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
  224. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
  225. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
  226. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
  227. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
  228. package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
  229. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
  230. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
  231. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
  232. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
  233. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
  234. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
  235. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
  236. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
  237. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
  238. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
  239. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
  240. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
  241. package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
  242. package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
  243. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
  244. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
  245. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
  246. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
  247. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
  248. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
  249. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
  250. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
  251. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
  252. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
  253. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
  254. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
  255. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
  256. package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
  257. package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
  258. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
  259. package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
  260. package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
  261. package/dist/chunk-AMBFK2K3.js +0 -28
@@ -0,0 +1,827 @@
1
+ ---
2
+ code: client_cpp_sdk_installation
3
+ name: "C++"
4
+ wikiToken: E8ekwJ170iMfb8ktBPfcYxE4nq0
5
+ parentWikiToken: FTcTwinIOi3OiRkK4MPc2Ex7neg
6
+ updateTime: 1760169183000
7
+ sourceUrl: https://docs-v2.thinkingdata.cn/?version=6.0&lan=zh-CN&code=client_cpp_sdk_installation
8
+ ---
9
+
10
+ # C++
11
+
12
+ ::: tip Note
13
+
14
+ Before integration, please read the Pre-installation Guide first.
15
+
16
+ You can get the C++ SDK source code on GitHub.
17
+
18
+ C++ SDK supports running on Mac and Windows platforms, supports C++ 11 and above, and is approximately 144KB in size.
19
+
20
+ :::
21
+
22
+ **Latest Version:** v1.5.3
23
+
24
+ **Update Time:** 2025-10-11
25
+
26
+ **Resource Download:** SDK Source Code
27
+
28
+ ### I. SDK Integration
29
+
30
+ #### 1.1 Download SDK
31
+
32
+ Download the SDK source code, unzip it and enter the cpp-client/cpp folder.
33
+
34
+ The `include` folder contains the SDK header files, `src` contains the SDK source code files, and `thirdparty` contains the dependent third-party libraries.
35
+
36
+ #### 1.2 Add Dependencies
37
+
38
+ C++ SDK depends on sqlite, curl, zlib, and openssl libraries. Due to platform differences, the library formats also vary. You can use the pre-compiled libraries from ThinkingData or compile the libraries yourself.
39
+
40
+ ##### 1.2.1 Use Pre-compiled Libraries from ThinkingData
41
+
42
+ The libraries are compiled using a compiler on the Windows platform. Configure the compiled libraries in the thirdparty folder into your project. (.dll is dynamic library, .lib is static library)
43
+
44
+ ##### 1.2.2 Self-compile
45
+
46
+ Here is an example for Windows platform:
47
+
48
+ Download curl library from https://github.com/curl/curl/releases/tag/curl-7_61_1, unzip it, switch to the winbuild directory, and compile. The compilation command is as follows, and the compilation result is in the builds folder under the curl directory.
49
+
50
+ ```
51
+ nmake /f Makefile.vc mode=static ENABLE_IDN=no
52
+ ```
53
+
54
+ Download zlib library from https://github.com/madler/zlib/releases/tag/v1.2.11, unzip it, and execute the compilation command. The compilation result is in the zlib directory.
55
+
56
+ ```
57
+ nmake -f win32/Makefile.msc
58
+ ```
59
+
60
+ Download sqlite library from https://www.sqlite.org/download.html, and select the library for your specified platform.
61
+
62
+ <!-- unsupported block: 19 -->
63
+
64
+ Besides using command line, you can also use IDEs (Integrated Development Environments) such as Visual Studio or Clion to generate libraries for specific platforms.
65
+
66
+ Download openssl library from https://github.com/openssl/openssl, and compile the library for your specified platform yourself.
67
+
68
+ #### 1.3 Integrate SDK
69
+
70
+ ##### 1.3.1 Integration using CMake
71
+
72
+ Use CMake to integrate the C++ SDK. Copy the cpp folder to your project, and add the following configuration for Windows and Mac in the `CMakeLists.txt` file:
73
+
74
+ Set C++ version:
75
+
76
+ ```
77
+ set(CMAKE_CXX_STANDARD 11)
78
+ ```
79
+
80
+ Include header files:
81
+
82
+ ```
83
+ include_directories(cpp/include)
84
+ ```
85
+
86
+ Add Windows platform configuration:
87
+
88
+ ```
89
+ if(WIN32)
90
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8) # x64 platform
91
+ include_directories(cpp/thirdparty/x64/curl/include cpp/thirdparty/x64/zlib/include cpp/thirdparty/x64/sqlite/include cpp/thirdparty/x64/openssl/include)
92
+ link_directories(cpp/thirdparty/x64/curl/lib cpp/thirdparty/x64/zlib/lib cpp/thirdparty/x64/sqlite/lib cpp/thirdparty/x64/openssl/lib)
93
+ else() # Win32 platform
94
+ include_directories(cpp/thirdparty/x86/curl/include cpp/thirdparty/x86/zlib/include cpp/thirdparty/x86/sqlite/include cpp/thirdparty/x86/openssl/include)
95
+ link_directories(cpp/thirdparty/x86/curl/lib cpp/thirdparty/x86/zlib/lib cpp/thirdparty/x86/sqlite/lib cpp/thirdparty/x86/openssl/lib)
96
+ endif()
97
+ add_library(thinkingdata SHARED cpp/src/ta_analytics_sdk.cpp cpp/src/ta_cpp_helper.cpp cpp/src/ta_cpp_network.cpp cpp/src/ta_cpp_utils.cpp cpp/src/ta_sqlite.cpp cpp/src/ta_timer.cpp cpp/src/ta_event_task.cpp cpp/src/ta_cpp_send.cpp cpp/src/ta_json_object.cpp cpp/src/ta_cJSON.c cpp/src/ta_encrypt.cpp cpp/src/ta_calibrated_time.cpp cpp/src/ta_flush_task.cpp)
98
+ target_link_libraries(thinkingdata libcurl sqlite3 zlibwapi libssl libcrypto)
99
+ endif()
100
+ ```
101
+
102
+ Add Mac platform configuration:
103
+
104
+ ```
105
+ if (CMAKE_HOST_APPLE)
106
+ find_library(COCOA Cocoa)
107
+ find_library(IOKIT IOKit)
108
+ find_package(OpenSSL REQUIRED)
109
+ include_directories(${OPENSSL_INCLUDE_DIR})
110
+ link_directories(${OPENSSL_LIBRARIES})
111
+ add_library(thinkingdata SHARED cpp/src/ta_analytics_sdk.cpp cpp/src/ta_cpp_helper.cpp cpp/src/ta_cpp_network.cpp cpp/src/ta_cpp_utils.cpp cpp/src/ta_sqlite.cpp cpp/src/ta_timer.cpp cpp/src/ta_event_task.cpp cpp/src/ta_cpp_send.cpp cpp/src/ta_json_object.cpp cpp/src/ta_cJSON.c cpp/src/ta_mac_tool.mm cpp/src/ta_encrypt.cpp cpp/src/ta_calibrated_time.cpp cpp/src/ta_flush_task.cpp)
112
+ target_link_libraries(thinkingdata curl z sqlite3 ${OPENSSL_LIBRARIES} ${COCOA} ${IOKIT})
113
+ endif()
114
+ ```
115
+
116
+ ##### 1.3.2 Self-compile
117
+
118
+ You can use IDE (Integrated Development Environment) to compile ThinkingData libraries yourself
119
+
120
+ 1. Download the SDK code, cd to the cmakelist file directory
121
+ 1. Execute the following commands
122
+
123
+ ```
124
+ //windows platform using Visual Studio to compile
125
+ //x86
126
+ cmake -S . -B build -G "Visual Studio 17 2022" -A Win32
127
+ //x64
128
+ cmake -S . -B build -G "Visual Studio 17 2022" -A x64
129
+ ```
130
+
131
+ ```
132
+ //Mac platform
133
+ // arm64 platform m1
134
+ arch -arm64 cmake -B build
135
+ arch -arm64 cmake --build build
136
+
137
+ //x86_64 platform intel
138
+ arch -x86_64 cmake -B build
139
+ arch -x86_64 cmake --build build
140
+ ```
141
+
142
+ ##### 1.3.3 Integration using Source Code
143
+
144
+ After completing the third-party dependency configuration in step 1.2, add the include and src folders to your project.
145
+
146
+ ##### 1.3.4 Use Pre-compiled Libraries
147
+
148
+ SDK Download
149
+
150
+ After downloading and unzipping, you can find the corresponding dll files for x64 and x86 platforms, which can be used directly.
151
+
152
+ ### II. Initialize SDK
153
+
154
+ ```
155
+ #include "ta_analytics_sdk.h"
156
+ #include "ta_json_object.h"
157
+
158
+ using namespace thinkingdata;
159
+
160
+ ThinkingAnalyticsAPI::Init(SERVER_URL, APPID);
161
+ ```
162
+
163
+ Parameter description:
164
+
165
+ - `APPID`: Your project's APPID, which can be obtained from the TE backend project management page
166
+ - `SERVER_URL`: The URL for data upload
167
+ - If you are connecting to cloud service, enter: https://global-receiver-ta.thinkingdata.cn
168
+ - If you are using a privately deployed version, please bind a domain name for the data collection address and configure an HTTPS certificate: https://your-data-collection-domain
169
+
170
+ ### III. Common Features
171
+
172
+ Before using common features, we recommend that you first understand the user identification rules; SDK will generate a random number as a visitor ID by default, and persistently store the visitor ID locally; before the user logs in, the visitor ID will be used as the identity identification ID. Note: The visitor ID will change when the user reinstalls the App or changes the device.
173
+
174
+ #### 3.1 Set Account ID
175
+
176
+ When a user logs in, you can call `Login` to set the user's account ID. The TE platform will use the account ID as the identity identification ID, and the set account ID will be retained until `Logout` is called. Calling `Login` multiple times will override the previous account ID.
177
+
178
+ ```
179
+ // The user's unique login identifier, this data corresponds to #account_id in the reported data, at this time #account_id is "TA"
180
+ ThinkingAnalyticsAPI::Login("TA");
181
+ ```
182
+
183
+ `Login` can be called multiple times. Each call will determine whether the passed account ID is consistent with the previously saved ID. If consistent, the call will be ignored; if inconsistent, the previous ID will be overridden.
184
+
185
+ <!-- unsupported block: 34 -->
186
+
187
+ **This method will not upload a login event**
188
+
189
+ #### 3.2 Send Event
190
+
191
+ You can call `track` to upload events. It is recommended that you set event properties and conditions for sending information based on your previously documented tracking requirements. Here is an example of a user purchasing a product:
192
+
193
+ ```
194
+ TDJSONObject event_properties;
195
+ event_properties.SetString("name1", "name1");//string
196
+ event_properties.SetNumber("test_number_int", 3);//number
197
+ event_properties.SetBool("test_bool", true);//bool
198
+ event_properties.SetDateTime("test_time1", time(NULL), 0);//time
199
+ std::vector<std::string> test_list;
200
+ test_list.push_back("item11");
201
+ test_list.push_back("item21");
202
+ event_properties.SetList("test_list1", test_list);//array
203
+ ThinkingAnalyticsAPI::Track("CPP_event", event_properties);
204
+ ```
205
+
206
+ - The event name is a string type, can only start with a letter, can contain numbers, letters and underscores "\_", with a maximum length of 50 characters.
207
+ - Event properties are of `TDJSONObject` type, where each element represents a property;
208
+ - Event property `Key` is the property name, is a string type, and can only start with a letter, contain numbers, letters and underscores "\_", with a maximum length of 50 characters, and is case-insensitive for letters;
209
+ - Property values support string, number, boolean, array, and time types.
210
+ <!-- unsupported block: 34 -->
211
+
212
+ **User property requirements are the same as event property requirements**
213
+
214
+ #### 3.3 Set User Properties
215
+
216
+ For general user properties, you can call `UserSet` to set them. Properties uploaded using this interface will override existing property values. If the user property did not exist before, it will be created with the same type as the uploaded property. Here is an example of setting the username:
217
+
218
+ ```
219
+ TDJSONObject userProperties;
220
+ userProperties.SetString("user_name", "TA");
221
+ ThinkingAnalyticsAPI::UserSet(userProperties);
222
+ ```
223
+
224
+ ### IV. Best Practices
225
+
226
+ The following example code includes all the above operations. We recommend following these steps:
227
+
228
+ ```
229
+ #include "ta_analytics_sdk.h"
230
+ using namespace thinkingdata;
231
+ //Initialize SDK
232
+ ThinkingAnalyticsAPI::Init(SERVER_URL, APPID);
233
+ //If the user has logged in, you can set the user's account ID as the unique identifier
234
+ ThinkingAnalyticsAPI::Login("TA");
235
+ //Send event
236
+ TDJSONObject event_properties;
237
+ event_properties.SetString("name1", "name1");//string
238
+ event_properties.SetNumber("test_number_int", 3);//number
239
+ event_properties.SetBool("test_bool", true);//bool
240
+ event_properties.SetDateTime("test_time1", time(NULL), 0);//time
241
+ std::vector<std::string> test_list;
242
+ test_list.push_back("item11");
243
+ test_list.push_back("item21");
244
+ event_properties.SetList("test_list1", test_list);//array
245
+ ThinkingAnalyticsAPI::Track("CPP_event", event_properties);;
246
+ //Set user properties
247
+ TDJSONObject userProperties;
248
+ userProperties1.SetString("user_name", "TA");
249
+ ThinkingAnalyticsAPI::UserSet(userProperties);
250
+ ```
251
+
252
+ ---
253
+
254
+ # Advanced Guide
255
+
256
+ ### I. Set User ID
257
+
258
+ The SDK instance defaults to using a random number as the default visitor ID for each user, which will serve as the identity identification ID for users in an unauthenticated state. Note that the visitor ID will change when the user reinstalls the application or changes the device.
259
+
260
+ #### 1.1 Set Visitor ID
261
+
262
+ ::: tip Note
263
+
264
+ Generally, you do not need to customize the visitor ID. Please ensure you understand the user identification rules before setting the visitor ID.
265
+
266
+ If you need to replace the visitor ID, you should call it immediately after initializing the SDK. Do not call it multiple times to avoid creating unnecessary accounts.
267
+
268
+ :::
269
+
270
+ If your App has its own visitor ID management system for each user, you can call `Identify` to set the visitor ID:
271
+
272
+ ```
273
+ // Set the visitor ID to "Thinker"
274
+ ThinkingAnalyticsAPI::Identify("Thinker");
275
+ ```
276
+
277
+ If you need to get the current visitor ID, you can call `DistinctID()`:
278
+
279
+ ```
280
+ //Return visitor ID
281
+ ThinkingAnalyticsAPI::DistinctID().c_str()
282
+ ```
283
+
284
+ #### 1.2 Set Account ID
285
+
286
+ When a user logs in, you can call `Login` to set the user's account ID. The TE platform will use the account ID as the identity identification ID, and the set account ID will be retained until `Logout` is called. Calling `Login` multiple times will override the previous account ID
287
+
288
+ ```
289
+ // The user's unique login identifier, this data corresponds to #account_id in the reported data, at this time #account_id is "TA"
290
+ ThinkingAnalyticsAPI::Login("TA");
291
+ ```
292
+
293
+ <!-- unsupported block: 34 -->
294
+
295
+ **This method will not upload a login event**
296
+
297
+ #### 1.3 Clear Account ID
298
+
299
+ After a user logs out, you can call `LogOut` to clear the account ID. Before calling `Login` again, the visitor ID will be used as the identity identification ID.
300
+
301
+ ```
302
+ ThinkingAnalyticsAPI::LogOut();
303
+ ```
304
+
305
+ We recommend that you call `LogOut` only when there is an explicit logout behavior, such as when the user actively cancels their account, rather than when the App is closed.
306
+
307
+ <!-- unsupported block: 34 -->
308
+
309
+ **This method will not upload a logout event**
310
+
311
+ ### II. Send Events
312
+
313
+ After the SDK initialization is complete, you can perform data tracking and collect user behavior information. Generally, ordinary events can meet business scenario requirements. You can also use first-time events, updatable events, etc. according to your actual business scenarios.
314
+
315
+ #### 2.1 Ordinary Events
316
+
317
+ You can call `Track` to upload events. We recommend that you set event properties and conditions for sending events based on your previously documented tracking requirements. Here is an example of a user purchasing a product:
318
+
319
+ ```
320
+ //Store purchase event
321
+ TDJSONObject event_properties;
322
+ event_properties.SetString("product_name", "Product Name");
323
+ ThinkingAnalyticsAPI::Track("product_buy", event_properties);
324
+ ```
325
+
326
+ #### 2.2 First-time Event
327
+
328
+ First-time events refer to events that will only be recorded once for a certain device or other dimensional ID. For example, in some scenarios, you may want to record an activation event on a certain device, then you can use first-time events to report the data.
329
+
330
+ ```
331
+ TDJSONObject jsonObject1;
332
+ jsonObject1.SetString("test","test");
333
+ TDFirstEvent *firstEvent = new TDFirstEvent("device_activation",jsonObject1);
334
+ ThinkingAnalyticsAPI::Track(firstEvent);
335
+ delete firstEvent;
336
+ ```
337
+
338
+ If you want to determine whether it is the first time based on other dimensions other than the device, you can customize the first_check_id for the first-time event:
339
+
340
+ ```
341
+ //Set the user ID as the first_check_id of the first-time event to implement the collection of user first activation event
342
+ TDJSONObject jsonObject1;
343
+ jsonObject1.SetString("test","test");
344
+ TDFirstEvent *firstEvent = new TDFirstEvent("account_activation",jsonObject1);
345
+ firstEvent->setFirstCheckId("TA");
346
+ ThinkingAnalyticsAPI::Track(firstEvent);
347
+ delete firstEvent;
348
+ ```
349
+
350
+ <!-- unsupported block: 34 -->
351
+
352
+ Note: Since the verification of whether it is the first time is completed on the server side, first-time events will be delayed by 1 hour before entering the database by default.
353
+
354
+ #### 2.3 Updatable Events
355
+
356
+ You can implement the need to modify event data in specific scenarios through updatable events. Updatable events need to specify an ID that identifies the event, and pass it when creating the updatable event object. The TE backend will determine the data to be updated based on the event name and event ID.
357
+
358
+ ```
359
+ // Example: Report an event that can be updated, assuming the event name is UPDATABLE_EVENT
360
+ // After reporting, the event property status is 3, price is 100
361
+ TDJSONObject jsonObject;
362
+ jsonObject.SetNumber("status", 3);
363
+ jsonObject.SetNumber("price", 100);
364
+ TDUpdatableEvent *updatableEvent = new TDUpdatableEvent("UPDATABLE_EVENT",jsonObject,"test_event_id");
365
+ ThinkingAnalyticsAPI::Track(updatableEvent);
366
+ delete updatableEvent;
367
+
368
+ // After reporting, the event property status is updated to 5, price remains unchanged
369
+ TDJSONObject jsonObject1;
370
+ jsonObject1.SetNumber("status", 5);
371
+ TDUpdatableEvent *updatableEvent1 = new TDUpdatableEvent("UPDATABLE_EVENT",jsonObject1,"test_event_id");
372
+ ThinkingAnalyticsAPI::Track(updatableEvent1);
373
+ delete updatableEvent1;
374
+ ```
375
+
376
+ #### 2.4 Overwritable Events
377
+
378
+ Overwritable events are similar to updatable events, the difference is that overwritable events will completely overwrite historical data with the latest data, which effectively is equivalent to deleting the previous data and storing the latest data. The TE backend will determine the data to be updated based on the event name and event ID.
379
+
380
+ ```
381
+ // Example: Report an event that can be overwritten, assuming the event name is OVERWRITE_EVENT
382
+ // After reporting, the event property status is 3, price is 100
383
+ TDJSONObject jsonObject;
384
+ jsonObject.SetNumber("status", 3);
385
+ jsonObject.SetNumber("price", 100);
386
+ TDOverWritableEvent *event = new TDOverWritableEvent("OVERWRITE_EVENT",jsonObject,"test_event_id");
387
+ ThinkingAnalyticsAPI::Track(event);
388
+ delete event;
389
+
390
+ // After reporting, the event property status is updated to 5, price property is deleted
391
+ TDJSONObject jsonObject1;
392
+ jsonObject1.SetNumber("status", 5);
393
+ TDOverWritableEvent *event1 = new TDOverWritableEvent("OVERWRITE_EVENT",jsonObject1,"test_event_id");
394
+ ThinkingAnalyticsAPI::Track(event1);
395
+ delete event;
396
+ ```
397
+
398
+ #### 2.5 Public Event Properties
399
+
400
+ Public event properties refer to properties that will be uploaded with every event.
401
+
402
+ ##### 2.5.1 Static Public Event Properties
403
+
404
+ Static public event properties are properties that change infrequently and are present in every event, such as user membership level. After setting static public event properties through `setSuperProperties`, the SDK will obtain the set public event properties as event properties when collecting events.
405
+
406
+ ```
407
+ TDJSONObject superProperties;
408
+ superProperties.SetNumber("vip_level",2);
409
+ ThinkingAnalyticsAPI::SetSuperProperty(superProperties);
410
+ ```
411
+
412
+ Static public event properties will be saved to the cache and do not need to be called every time the App starts. If the property already exists, the newly set property will override the original property value; if the property did not exist before, a new property will be created. Besides setting properties, we also provide other APIs to manage static public event properties to meet daily business needs.
413
+
414
+ ```
415
+ //Clear a specific public event property
416
+ TDAnalytics.unsetSuperProperty("Channel");
417
+ //Clear all public event properties
418
+ ThinkingAnalyticsAPI::ClearSuperProperties();
419
+ //Get all public event properties
420
+ TDJSONObject superJson;
421
+ ThinkingAnalyticsAPI::GetSuperProperties(superJson);
422
+ ```
423
+
424
+ ##### 2.5.2 Dynamic Public Event Properties
425
+
426
+ Dynamic public event properties are properties that change frequently and are present in every event, such as the number of gold coins a user has. After setting the dynamic public property class through `SetDynamicSuperProperties`, the SDK will automatically obtain the properties during event collection and add them to the triggered event.
427
+
428
+ ```
429
+ TDJSONObject GetDynamicSuperProperties(){
430
+ TDJSONObject json;
431
+ json.SetNumber("coin",10);
432
+ return json;
433
+ }
434
+ ThinkingAnalyticsAPI::Init(config);
435
+ ThinkingAnalyticsAPI::SetDynamicSuperProperties(GetDynamicSuperProperties);
436
+ ```
437
+
438
+ #### 2.6 Record Event Duration
439
+
440
+ 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 that event, a `#duration` property will automatically be added to your event properties to represent the recorded duration in seconds. Note that only one timing task can exist for the same event name.
441
+
442
+ ```
443
+ //The following example completes the statistics of the user's stay duration on a certain product page
444
+ try {
445
+ //User enters the product page, start timing
446
+ ThinkingAnalyticsAPI::TimeEvent("stay_shop");
447
+ /**do someting
448
+ .......
449
+ **/
450
+ //User leaves the product page, timing ends, the "stay_shop" event will have a property #duration representing the event duration
451
+ ThinkingAnalyticsAPI::TimeEvent("stay_shop");
452
+ } catch (JSONException e) {
453
+ e.printStackTrace();
454
+ }
455
+ ```
456
+
457
+ ### III. User Properties
458
+
459
+ The user property setting interfaces currently supported by TE platform are: `UserSet`, `UserSetOnce`, `UserAdd`, `UserUnset`, `UserDelete`, `UserAppend`.
460
+
461
+ #### 3.1 UserSet
462
+
463
+ For general user properties, you can call `UserSet` to set them. Properties uploaded using this interface will override existing property values. If the user property did not exist before, it will be created with the same type as the uploaded property. Here is an example of setting the username:
464
+
465
+ ```
466
+ TDJSONObject userProperties;
467
+ userProperties.SetString("username", "TA");
468
+ ThinkingAnalyticsAPI::UserSet(userProperties);
469
+ //At this time userName is TE
470
+ TDJSONObject userProperties1;
471
+ userProperties1.SetString("username", "TE");
472
+ ThinkingAnalyticsAPI::UserSet(userProperties1)
473
+ ```
474
+
475
+ #### 3.2 UserSetOnce
476
+
477
+ If you need to upload user properties that should only be set once, you can call `UserSetOnce` to set them. When the property already has a value, this information will be ignored. Here is an example of setting the first payment time:
478
+
479
+ ```
480
+ //first_payment_time is 2018-01-01 01:23:45.678
481
+ TDJSONObject userProperties;
482
+ userProperties.SetString("first_payment_time","2018-01-01 01:23:45.678");
483
+ ThinkingAnalyticsAPI::UserSetOnce(userProperties);
484
+
485
+ //first_payment_time is still 2018-01-01 01:23:45.678
486
+ TDJSONObject userProperties1;
487
+ userProperties1.SetString("first_pay_time","2018-12-31 01:23:45.678");
488
+ ThinkingAnalyticsAPI::UserSetOnce(userProperties1);
489
+ ```
490
+
491
+ #### 3.3 UserAdd
492
+
493
+ When you need to upload numeric properties, you can call `UserAdd` to perform an accumulation operation on the property. If the property has not been set, it will be assigned 0 before calculation. Negative values can be passed, which is equivalent to a subtraction operation. Here is an example of accumulating total payment amount:
494
+
495
+ ```
496
+ //At this time total_revenue is 30
497
+ TDJSONObject userProperties;
498
+ userProperties.SetNumber("total_revenue",30;
499
+ ThinkingAnalyticsAPI::UserAdd(userProperties);
500
+ //At this time total_revenue is 678
501
+ TDJSONObject userProperties1;
502
+ userProperties1.SetNumber("total_revenue",648);
503
+ ThinkingAnalyticsAPI::UserAdd(userProperties1);
504
+ ```
505
+
506
+ <!-- unsupported block: 34 -->
507
+
508
+ The property key is a string, and Value only allows numeric values.
509
+
510
+ #### 3.4 UserUnset
511
+
512
+ If you need to reset a user's property, you can call `UserUnset` to clear the value of a specified user property. This interface supports passing string or list type parameters:
513
+
514
+ ```
515
+ ThinkingAnalyticsAPI::UserUnset("userUnset_key");
516
+ ```
517
+
518
+ <!-- unsupported block: 34 -->
519
+
520
+ The passed value is the Key of the property to be cleared.
521
+
522
+ #### 3.5 UserDelete
523
+
524
+ If you need to delete a user, you can call `UserDelete` to delete that user. You will no longer be able to query that user's user properties, but the events generated by that user can still be queried.
525
+
526
+ ```
527
+ ThinkingAnalyticsAPI::UserDelete();
528
+ ```
529
+
530
+ #### 3.6 UserAppend
531
+
532
+ You can call `UserAppend` to append elements to `List` type user properties:
533
+
534
+ ```
535
+ TDJSONObject userProperties;
536
+ vector<string> listValue;
537
+ listValue.push_back("apple");
538
+ listValue.push_back("ball");
539
+ userProperties.SetList("user_list",listValue);
540
+ ThinkingAnalyticsAPI::UserAppend(userProperties);
541
+ ```
542
+
543
+ #### 3.7 UserUniqAppend
544
+
545
+ You can call `UserUniqAppend` to append elements to array type user properties. Calling `UserUniqAppend` interface will deduplicate the appended user properties, while `UserAppend` interface does not deduplicate, so user properties may contain duplicates.
546
+
547
+ ```
548
+ //At this time user_list property value is ["apple", "ball"]
549
+ TDJSONObject userProperties1;
550
+ vector<string> listValue1;
551
+ listValue1.push_back("apple");
552
+ listValue1.push_back("ball");
553
+ userProperties1.SetList("user_list",listValue1);
554
+ ThinkingAnalyticsAPI::UserAppend(userProperties1);
555
+
556
+ //At this time user_list property value is ["apple", "apple", "ball", "cube"]
557
+ TDJSONObject userProperties2;
558
+ vector<string> listValue1;
559
+ listValue2.push_back("apple");
560
+ listValue2.push_back("cube");
561
+ userProperties2.SetList("user_list",listValue2);
562
+ ThinkingAnalyticsAPI::UserAppend(userProperties2);
563
+
564
+ //At this time user_list property value is ["apple", "ball", "cube"]
565
+ ThinkingAnalyticsAPI::UserUniqAppend(userProperties2);
566
+
567
+ ```
568
+
569
+ ### IV. Encryption Function
570
+
571
+ Starting from version v1.3.7, SDK supports using AES+RSA to encrypt data. The data encryption function requires client and server to work together. Please consult your customer success manager for specific usage.
572
+
573
+ ```
574
+ TDConfig config;
575
+ config.appid = appid;
576
+ config.server_url = server_url;
577
+ config.EnableEncrypt(1,"publickKey");
578
+ ThinkingAnalyticsAPI::Init(config);
579
+ ```
580
+
581
+ ### V. Other Features
582
+
583
+ #### 5.1 Print SDK Logs
584
+
585
+ You can enable SDK log printing through the EnableLog interface. After enabling, the reported data will be printed in the IDE console.
586
+
587
+ ```
588
+ ThinkingAnalyticsAPI::EnableLog(true);
589
+ ```
590
+
591
+ #### 5.2 Preset Properties Description
592
+
593
+ **Property Name**
594
+
595
+ **Chinese Name**
596
+
597
+ **Property Type**
598
+
599
+ **Description**
600
+
601
+ #ip
602
+
603
+ IP Address
604
+
605
+ Text
606
+
607
+ User's IP address, TE will use this to obtain user's geographic location information
608
+
609
+ #country
610
+
611
+ Country
612
+
613
+ Text
614
+
615
+ User's country, generated based on IP address
616
+
617
+ #country_code
618
+
619
+ Country Code
620
+
621
+ Text
622
+
623
+ User's country code (ISO 3166-1 alpha-2, i.e., two uppercase English letters), generated based on IP address
624
+
625
+ #province
626
+
627
+ Province
628
+
629
+ Text
630
+
631
+ User's province, generated based on IP address
632
+
633
+ #city
634
+
635
+ City
636
+
637
+ Text
638
+
639
+ User's city, generated based on IP address
640
+
641
+ #os
642
+
643
+ Operating System
644
+
645
+ Text
646
+
647
+ Such as MacOS, Windows, etc.
648
+
649
+ #device_id
650
+
651
+ Device ID
652
+
653
+ Text
654
+
655
+ User's device ID
656
+
657
+ #lib
658
+
659
+ SDK Type
660
+
661
+ Text
662
+
663
+ The type of SDK you integrated, such as Android, iOS, etc.
664
+
665
+ #lib_version
666
+
667
+ SDK Version
668
+
669
+ Text
670
+
671
+ The version of SDK you integrated
672
+
673
+ #### 5.3 Calibrate Time
674
+
675
+ By default, SDK uses the local time as the event occurrence time. If users manually modify the device time, it will affect your business analysis. At this time, you can ensure the accuracy of event occurrence time through time calibration operations. We provide two time calibration methods: `timestamp` and `automatic`.
676
+
677
+ - You can use the current timestamp obtained from the 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 the occurrence time.
678
+
679
+ ```
680
+ // 1585633785954 is the current unix timestamp in milliseconds, corresponding to Beijing time 2020-03-31 13:49:45
681
+ ThinkingAnalyticsAPI::CalibrateTime(1585633785954);
682
+ ```
683
+
684
+ - You can also set automatic time calibration. After that, SDK will attempt to obtain the current time from the config interface and calibrate SDK time. If the correct return result is not obtained, the local time will be used to report data subsequently.
685
+
686
+ ```
687
+ TDConfig config;
688
+ config.appid = appid;
689
+ config.server_url = server_url;
690
+ config.enableAutoCalibrated = true;
691
+ ThinkingAnalyticsAPI::Init(config);
692
+ ```
693
+
694
+ #### 5.4 Flush Data Immediately
695
+
696
+ In some business scenarios, if you expect data to be reported to the TE server immediately, you can complete it by calling the `flush` interface
697
+
698
+ ```
699
+ ThinkingAnalyticsAPI::Flush();
700
+ ```
701
+
702
+ #### 5.5 Get Device ID
703
+
704
+ You can get the device ID by calling `getDeviceId`:
705
+
706
+ ```
707
+ ThinkingAnalyticsAPI::GetDeviceId();
708
+ ```
709
+
710
+ #### 5.6 Set Default Timezone
711
+
712
+ By default, SDK uses the device's local time at the time of the interface call as the event occurrence time for reporting. You can also set a default timezone through the interface so that all events will be aligned to the event time according to the timezone you set:
713
+
714
+ ```
715
+ TDConfig config;
716
+ config.appid = appid;
717
+ config.server_url = server_url;
718
+ config.zoneOffset = 5;
719
+ ThinkingAnalyticsAPI::Init(config);
720
+ ```
721
+
722
+ <!-- unsupported block: 34 -->
723
+
724
+ Note: Aligning event time with a specified timezone will lose the device's local timezone information. If you need to preserve the device's local timezone information, you currently need to add relevant properties to the event yourself.
725
+
726
+ ---
727
+
728
+ # Real-time Debugging
729
+
730
+ During SDK integration, you can perform real-time debugging by viewing SDK logs in the IDE console or using TE's Debug feature.
731
+
732
+ ### I. Print SDK Logs
733
+
734
+ ```
735
+ TDAnalytics.EnableLogType(TDLogType.LogTxt);
736
+ ```
737
+
738
+ <!-- unsupported block: 34 -->
739
+
740
+ After enabling logs, you can filter ThinkingAnalytics related logs in the IDE to observe SDK data reporting.
741
+
742
+ ### II. Enable Debug Mode
743
+
744
+ Enabling Debug mode requires the following two steps:
745
+
746
+ 1. Enable Debug mode on the client side
747
+ The following is an example code for enabling Debug mode on the client side:
748
+
749
+ ```
750
+ // Get TDConfig instance
751
+ TDConfig config = new TDConfig();
752
+ config.appid = TA_APP_ID;
753
+ config.server_url = TA_SERVER_URL;
754
+ /*
755
+ Set the running mode to Debug mode
756
+ NORMAL mode: Data will be stored in cache and reported according to a certain cache strategy. Default is NORMAL mode; recommended for production environment
757
+ Debug mode: Data is reported one by one. When problems occur, users will be prompted with logs and exceptions; not recommended for production environment
758
+ DebugOnly mode: Only validates data, will not be stored in database; not recommended for production environment
759
+ */
760
+ config.mode = TDMode.Debug;
761
+ // Initialize SDK
762
+ TDAnalytics.Init(config);
763
+ ```
764
+
765
+ 1. Add Debug device in TE backend
766
+ To prevent Debug mode from being launched in production environments, only specified devices can enable Debug mode. Debug mode can only be enabled if Debug mode is enabled on the client side and the device ID is configured in the "Debug Data" section of the "Tracking Management" page in TE backend.
767
+
768
+ Device ID can be obtained through the following three ways:
769
+
770
+ - The #device_id property in event data in TE platform
771
+ - Client logs: SDK will print device DeviceId after initialization completes
772
+ - Through instance interface call: Get Device ID
773
+ <!-- unsupported block: 34 -->
774
+
775
+ Debug mode may affect data collection quality and App stability, it is only used for data verification during integration stage, do not use it in production environment.
776
+
777
+ ---
778
+
779
+ # Real-time Debugging
780
+
781
+ During SDK integration, you can perform real-time debugging by viewing SDK logs in the IDE console or using TE's Debug feature.
782
+
783
+ ### I. Print SDK Logs
784
+
785
+ ```
786
+ ThinkingAnalyticsAPI::EnableLogType(LOGCONSOLE);//Print logs to console
787
+ ThinkingAnalyticsAPI::EnableLogType(LOGTXT);//Output logs to local file
788
+ ```
789
+
790
+ <!-- unsupported block: 34 -->
791
+
792
+ After enabling logs, you can filter ThinkingAnalytics related logs in the IDE to observe SDK data reporting.
793
+
794
+ ### II. Enable Debug Mode
795
+
796
+ Enabling Debug mode requires the following two steps:
797
+
798
+ 1. Enable Debug mode on the client side
799
+ The following is an example code for enabling Debug mode on the client side:
800
+
801
+ ```
802
+ // Get TDConfig instance
803
+ TDConfig config;
804
+ config.appid = TA_APP_ID;
805
+ config.server_url = TA_SERVER_URL;
806
+ /*
807
+ Set the running mode to Debug mode
808
+ NORMAL mode: Data will be stored in cache and reported according to a certain cache strategy. Default is NORMAL mode; recommended for production environment
809
+ Debug mode: Data is reported one by one. When problems occur, users will be prompted with logs and exceptions; not recommended for production environment
810
+ DebugOnly mode: Only validates data, will not be stored in database; not recommended for production environment
811
+ */
812
+ config.mode = TDMode.TD_DEBUG;
813
+ // Initialize SDK
814
+ ThinkingAnalyticsAPI::Init(config);
815
+ ```
816
+
817
+ 1. Add Debug device in TE backend
818
+ To prevent Debug mode from being launched in production environments, only specified devices can enable Debug mode. Debug mode can only be enabled if Debug mode is enabled on the client side and the device ID is configured in the "Debug Data" section of the "Tracking Management" page in TE backend.
819
+
820
+ Device ID can be obtained through the following three ways:
821
+
822
+ - The #device_id property in event data in TE platform
823
+ - Client logs: SDK will print device DeviceId after initialization completes
824
+ - Through instance interface call: Get Device ID
825
+ <!-- unsupported block: 34 -->
826
+
827
+ Debug mode may affect data collection quality and App stability, it is only used for data verification during integration stage, do not use it in production environment.