@thinkingai/ae-cli 6.0.58 → 6.0.60

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 (253) hide show
  1. package/README.md +10 -5
  2. package/README.zh.md +10 -5
  3. package/bin/ai-monitor.js +2 -0
  4. package/dist/ai-monitor-FCXSLHAP.js +32 -0
  5. package/dist/ai-monitor.js +135 -0
  6. package/dist/{auth-A5OO4VS4.js → auth-ATK2SLEV.js} +10 -9
  7. package/dist/{automation-FD2QZUP6.js → automation-FLCPFMN4.js} +4 -4
  8. package/dist/{capability-SKI4GHF4.js → capability-6KTSOI7L.js} +31 -35
  9. package/dist/{chunk-UYJMEHAF.js → chunk-2ETRY2CU.js} +15 -15
  10. package/dist/{chunk-QWSA3EOD.js → chunk-5E7MTTFN.js} +2 -2
  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-AXTO4FTM.js +1285 -0
  15. package/dist/{chunk-HQCY3QCA.js → chunk-BEYLCUZX.js} +17 -12
  16. package/dist/chunk-CF6JTT2U.js +64 -0
  17. package/dist/{chunk-VDICGXCY.js → chunk-F2VFZUGG.js} +2 -2
  18. package/dist/{chunk-K2Z7QHDR.js → chunk-HSZAIPUX.js} +47 -12
  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-E25OSZLJ.js → chunk-KTJXD27G.js} +2 -2
  22. package/dist/{chunk-GBSACKFB.js → chunk-LOR4IA26.js} +564 -314
  23. package/dist/{chunk-YVG6QD3V.js → chunk-P7QDCWJ6.js} +98 -7
  24. package/dist/{chunk-EEARZNHE.js → chunk-SDKW6LYE.js} +88 -36
  25. package/dist/{chunk-WMDO53YK.js → chunk-VJUXKVRE.js} +1 -1
  26. package/dist/chunk-VRMGHQKE.js +556 -0
  27. package/dist/{compat-check-WFEKVLTH.js → compat-check-XD2U7PZ2.js} +2 -2
  28. package/dist/{config-U4I7X25P.js → config-U3GDWU6E.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 +84 -579
  32. package/dist/{memory-SNFR5M23.js → memory-WEB27VI6.js} +7 -7
  33. package/dist/{metadata-6QM6EED5.js → metadata-7FYE4234.js} +7 -7
  34. package/dist/{model-KEVCEXWD.js → model-T7H7Q6BG.js} +2 -2
  35. package/dist/{personal-semantic-preference-7VXQPP2N.js → personal-semantic-preference-O6VXM74A.js} +6 -6
  36. package/dist/{project-semantic-PSEPYH2L.js → project-semantic-2GGFJWW6.js} +15 -13
  37. package/dist/{sync-22ACDK5Z.js → sync-ULBB7WO5.js} +4 -4
  38. package/dist/{te-agent-BJ36B4QI.js → te-agent-6RMF7LUV.js} +5 -5
  39. package/dist/{te-analysis-WQ6D6YG4.js → te-analysis-HSYC7GNV.js} +382 -193
  40. package/dist/{te-community-VRWMFGI6.js → te-community-FLKZGQKB.js} +9 -9
  41. package/dist/{te-dataops-YTLFTTW7.js → te-dataops-OQQGTCUA.js} +3 -3
  42. package/dist/{te-engage-V2QW7TIC.js → te-engage-RIEBHL5T.js} +9 -9
  43. package/dist/{te-kb-4AQLISDR.js → te-kb-4HG2FMHJ.js} +18 -9
  44. package/dist/{te-system-CYWSK3UN.js → te-system-AL4B4XZL.js} +2 -2
  45. package/dist/{te-team-6ELNGBWT.js → te-team-5O4UVUWE.js} +5 -5
  46. package/dist/{things-HFWLGCUH.js → things-TSJ64GBT.js} +5 -5
  47. package/dist/{update-3CRVVHV5.js → update-Q5LURAWV.js} +3 -3
  48. package/dist/{workspace-2CKQX2XL.js → workspace-FF2HXJGR.js} +4 -4
  49. package/package.json +8 -6
  50. package/skills/ae-ai-monitor/SKILL.md +179 -0
  51. package/skills/ae-ai-monitor/references/read-commands.md +866 -0
  52. package/skills/ae-analysis/SKILL.md +10 -4
  53. package/skills/ae-analysis/references/adhoc_export.md +3 -1
  54. package/skills/ae-analysis/references/ai_models.md +1 -0
  55. package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
  56. package/skills/ae-analysis/references/asset_search.md +1 -1
  57. package/skills/ae-analysis/references/bad_case_begin.md +12 -0
  58. package/skills/ae-analysis/references/bad_case_get.md +12 -0
  59. package/skills/ae-analysis/references/bad_case_history.md +12 -0
  60. package/skills/ae-analysis/references/bad_case_list.md +12 -0
  61. package/skills/ae-analysis/references/bad_case_review.md +51 -0
  62. package/skills/ae-analysis/references/bad_case_run.md +12 -0
  63. package/skills/ae-analysis/references/bad_case_submit.md +12 -0
  64. package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
  65. package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
  66. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  67. package/skills/ae-analysis/references/bi_panel_share.md +3 -1
  68. package/skills/ae-analysis/references/catalog_list.md +2 -0
  69. package/skills/ae-analysis/references/command_index.md +38 -29
  70. package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
  71. package/skills/ae-analysis/references/dashboard_handover.md +3 -1
  72. package/skills/ae-analysis/references/dashboard_list.md +3 -3
  73. package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
  74. package/skills/ae-analysis/references/dashboard_share.md +3 -1
  75. package/skills/ae-analysis/references/dashboard_update.md +3 -2
  76. package/skills/ae-analysis/references/filter_value_list.md +2 -0
  77. package/skills/ae-analysis/references/folder_share.md +8 -2
  78. package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
  79. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
  80. package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
  81. package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
  82. package/skills/ae-analysis/references/project_member_add.md +3 -1
  83. package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
  84. package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
  85. package/skills/ae-analysis/references/project_member_update.md +3 -1
  86. package/skills/ae-analysis/references/project_owner_update.md +3 -1
  87. package/skills/ae-analysis/references/project_role_upsert.md +5 -3
  88. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
  89. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
  90. package/skills/ae-analysis/references/project_space_share.md +8 -2
  91. package/skills/ae-analysis/references/property_get.md +2 -0
  92. package/skills/ae-analysis/references/public_link_list.md +3 -1
  93. package/skills/ae-analysis/references/query_cancel.md +4 -1
  94. package/skills/ae-analysis/references/report_data_run.md +1 -1
  95. package/skills/ae-analysis/references/report_list.md +3 -3
  96. package/skills/ae-analysis/references/scenario_append.md +2 -2
  97. package/skills/ae-analysis/references/scenario_collect.md +15 -4
  98. package/skills/ae-analysis/references/scenario_list.md +2 -1
  99. package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
  100. package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
  101. package/skills/ae-analysis/references/user_tag_create.md +4 -1
  102. package/skills/ae-analysis/references/user_tag_get.md +2 -0
  103. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  104. package/skills/ae-analysis/references/user_tag_update.md +5 -2
  105. package/skills/ae-analysis/references/virtual_property_create.md +12 -1
  106. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
  107. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
  108. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
  109. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
  110. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
  111. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
  112. package/skills/ae-automation/SKILL.md +4 -2
  113. package/skills/ae-capability/SKILL.md +9 -5
  114. package/skills/ae-community/SKILL.md +1 -0
  115. package/skills/ae-dataops/SKILL.md +1 -0
  116. package/skills/ae-engage/SKILL.md +1 -0
  117. package/skills/ae-evaluation/SKILL.md +17 -2
  118. package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
  119. package/skills/ae-kb/SKILL.md +5 -3
  120. package/skills/ae-kb/references/analysis-workflow.md +11 -2
  121. package/skills/ae-kb/references/query-workflow.md +3 -1
  122. package/skills/ae-kb/references/versions.md +1 -1
  123. package/skills/ae-metadata/SKILL.md +1 -0
  124. package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
  125. package/skills/ae-team/SKILL.md +1 -1
  126. package/skills/ae-tracking-matrix/SKILL.md +170 -0
  127. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  128. package/skills/ae-tracking-matrix/i18n.yaml +12 -0
  129. package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
  130. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
  131. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
  132. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
  133. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
  134. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
  135. package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
  136. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
  137. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
  138. package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
  139. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
  140. package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
  141. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
  142. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
  143. package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
  144. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
  145. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
  146. package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
  147. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
  148. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
  149. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
  150. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
  151. package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
  152. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
  153. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
  154. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
  155. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
  156. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
  157. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
  158. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
  159. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
  160. package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
  161. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
  162. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
  163. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
  164. package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
  165. package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
  166. package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
  167. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
  168. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
  169. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
  170. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
  171. package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
  172. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
  173. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
  174. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
  175. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
  176. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
  177. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
  178. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
  179. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
  180. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
  181. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
  182. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
  183. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
  184. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
  185. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
  186. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
  187. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
  188. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
  189. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
  190. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
  191. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
  192. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
  193. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
  194. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
  195. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
  196. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
  197. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
  198. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
  199. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
  200. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
  201. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
  202. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
  203. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
  204. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
  205. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
  206. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
  207. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
  208. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
  209. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
  210. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
  211. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
  212. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
  213. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
  214. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
  215. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
  216. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
  217. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
  218. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
  219. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
  220. package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
  221. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
  222. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
  223. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
  224. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
  225. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
  226. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
  227. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
  228. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
  229. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
  230. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
  231. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
  232. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
  233. package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
  234. package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
  235. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
  236. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
  237. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
  238. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
  239. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
  240. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
  241. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
  242. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
  243. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
  244. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
  245. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
  246. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
  247. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
  248. package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
  249. package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
  250. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
  251. package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
  252. package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
  253. package/dist/chunk-AMBFK2K3.js +0 -28
@@ -0,0 +1,714 @@
1
+ ---
2
+ code: corona_sdk_installation
3
+ name: "Corona"
4
+ wikiToken: PVJhwxxtii9DDMkg45ecpCjJnge
5
+ parentWikiToken: BAU2w0eipiqGnckeUsIc0mYQnZc
6
+ updateTime: 1745310895000
7
+ sourceUrl: https://docs-v2.thinkingdata.cn/?version=6.0&lan=zh-CN&code=corona_sdk_installation
8
+ ---
9
+
10
+ # Corona
11
+
12
+ ::: tip Note
13
+
14
+ Before integration, please read the Pre-installation Guide first.
15
+
16
+ You can get the Corona SDK source code on GitHub.
17
+
18
+ Corona SDK supports running on iOS and Android platforms, size approximately 0.5M
19
+
20
+ :::
21
+
22
+ **Latest Version:** v2.0.1
23
+
24
+ **Update Time:** 2023-11-24
25
+
26
+ **Resource Download:** Source Code, SDK Download
27
+
28
+ ::: warning Warning
29
+
30
+ This document applies to v2.0.0 and later versions, for historical versions please refer to Corona Integration Guide (V1), SDK Download (v1.0.1)
31
+
32
+ :::
33
+
34
+ ### I. Integrate SDK
35
+
36
+ - **Add Corona Configuration**
37
+ - Download Corona SDK resource files, unzip the files and copy TDAnalytics.lua to the Corona directory
38
+ - **Add Android Configuration**
39
+ - Copy android/ThinkingPluginProxy.java to android/plugin/src/main/java/plugin/library directory
40
+ - Open Android project with Android Studio, switch display mode to Android, add dependencies in build.gradle, then click Sync Now to update
41
+
42
+ ```
43
+ dependencies {
44
+ implementation 'cn.thinkingdata.android:ThinkingAnalyticsSDK:3.0.0'
45
+ }
46
+ ```
47
+
48
+ - Add code in plugin.library.LuaLoader
49
+ ::: tip Note
50
+
51
+ If you haven't extended functionality in plugin.library.LuaLoader, you can directly copy android/LuaLoader.java to android/plugin/src/main/java/plugin/library directory, overwriting the original LuaLoader.java file.
52
+
53
+ :::
54
+
55
+ ```
56
+ public int invoke(LuaState L) {
57
+ NamedJavaFunction[] luaFunctions = new NamedJavaFunction[] {
58
+ ...
59
+ // ThinkingAnalyticsSDK add code
60
+ new ThinkingBridgingWrapper(),
61
+ ...
62
+ };
63
+ String libName = L.toString( 1 );
64
+ L.register(libName, luaFunctions);
65
+ return 1;
66
+ }
67
+
68
+ public void dispatchEvent(final String message) {
69
+ CoronaEnvironment.getCoronaActivity().getRuntimeTaskDispatcher().send( new CoronaRuntimeTask() {
70
+ @Override
71
+ public void executeUsing(CoronaRuntime runtime) {
72
+
73
+ LuaState L = runtime.getLuaState();
74
+ CoronaLua.newEvent( L, EVENT_NAME );
75
+
76
+ ...
77
+ // ThinkingAnalyticsSDK add code
78
+ JSONObject jsonObject = null;
79
+ String newMessage = null;
80
+ String type = null;
81
+ try {
82
+ jsonObject = new JSONObject(message);
83
+ newMessage = jsonObject.optString("message");
84
+ type = jsonObject.optString("type");
85
+ } catch (Exception ignored) {
86
+ }
87
+
88
+ if (!TextUtils.isEmpty(newMessage) && !TextUtils.isEmpty(type)) {
89
+ L.pushString(newMessage);
90
+ L.setField(-2, "message");
91
+ L.pushString(type);
92
+ L.setField(-2, "type");
93
+ } else {
94
+ L.pushString(message);
95
+ L.setField(-2, "message");
96
+ }
97
+ ...
98
+
99
+ try {
100
+ CoronaLua.dispatchEvent( L, fListener, 0 );
101
+ } catch (Exception ignored) {
102
+ }
103
+ }
104
+ } );
105
+ }
106
+
107
+ ...
108
+ // ThinkingAnalyticsSDK add code
109
+ @SuppressWarnings({"WeakerAccess", "SameReturnValue"})
110
+ public int thinkingBridging(LuaState L) {
111
+ CoronaActivity activity = CoronaEnvironment.getCoronaActivity();
112
+ if (activity == null) {
113
+ return 0;
114
+ }
115
+
116
+ String word = L.checkString( 1 );
117
+ JSONObject params = null;
118
+ try {
119
+ params = new JSONObject(word);
120
+ } catch (JSONException e) {
121
+ params = new JSONObject();
122
+ }
123
+ String method = params.optString("method");
124
+ if (method.length() > 0) {
125
+ try {
126
+ Class aClass = Class.forName("plugin.library.ThinkingPluginProxy");
127
+ Method aMethod = aClass.getDeclaredMethod(method, JSONObject.class);
128
+ JSONObject jsonObject = (JSONObject) aMethod.invoke(aClass, params);
129
+ if (jsonObject != null && jsonObject.getClass() == JSONObject.class && jsonObject.has("message")) {
130
+ (new Thread() {
131
+ @Override
132
+ public void run() {
133
+ dispatchEvent(jsonObject.toString());
134
+ }
135
+ }).start();
136
+ }
137
+ } catch (Exception e) {
138
+ e.printStackTrace();
139
+ }
140
+ }
141
+ return 0;
142
+ }
143
+ ...
144
+
145
+ ...
146
+ // ThinkingAnalyticsSDK add code
147
+ @SuppressWarnings("unused")
148
+ private class ThinkingBridgingWrapper implements NamedJavaFunction {
149
+ @Override
150
+ public String getName() {
151
+ return "thinkingBridging";
152
+ }
153
+
154
+ @Override
155
+ public int invoke(LuaState L) {
156
+ return thinkingBridging(L);
157
+ }
158
+ }
159
+ ...
160
+ ```
161
+
162
+ - **Add iOS Configuration**
163
+ - Open ios project with Xcode, drag and drop the ThinkingAnalyticsSDK folder under ios directory to App directory
164
+ - Enable project ARC support, select TARGETS -> App -> Build Settings -> Objective-C Automatic Reference Counting, and set to YES
165
+ - Some files need to disable ARC, select TARGETS -> App -> Build Phases -> Compile Sources -> ThinkingPluginLibrary.mm, and add setting -fno-objc-arc
166
+
167
+ ### II. Initialization
168
+
169
+ ```
170
+ -- Import TDAnalytics
171
+ local TDAnalytics = require("TDAnalytics")
172
+
173
+ -- Initialize TDAnalytics
174
+ local params = {
175
+ appId = "YOUR_APP_ID",
176
+ serverUrl = "YOUR_SERVER_URL"
177
+ }
178
+ TDAnalytics.init(params)
179
+ ```
180
+
181
+ <!-- unsupported block: 34 -->
182
+
183
+ Note: Since some devices prohibit plain text transmission by default, it is strongly recommended that you use HTTPS format for the receiving end address.
184
+
185
+ ### III. Common Features
186
+
187
+ #### 3.1 Set Account ID
188
+
189
+ When a user logs in, you can call `login` to set the user's account ID. After setting the account ID, it will be used as the user identifier ID, and the set account ID will be retained until `logout` is called:
190
+
191
+ ```
192
+ -- Set account ID
193
+ TDAnalytics.login("TA")
194
+ ```
195
+
196
+ <!-- unsupported block: 34 -->
197
+
198
+ Note: This method will not upload user login events.
199
+
200
+ #### 3.2 Set Public Event Properties
201
+
202
+ For some important properties, such as player server and channel, these properties need to be set in every event. You can set these properties as public event properties. Public event properties refer to properties that will be present in every event. You can call `setSuperProperties()` to set public event properties. We recommend that you set public event properties before sending events.
203
+
204
+ ```
205
+ -- Set public properties
206
+ TDAnalytics.setSuperProperties({
207
+ channel = "App Store",
208
+ trip = {"Car", "Train"}
209
+ })
210
+ ```
211
+
212
+ Public event properties will be saved to the cache and do not need to be called every time the APP starts. If you call `setSuperProperties()` to upload a previously set public event property, it will override the previous property. If the Key of a public event property and a property uploaded by `track()` are duplicated, the event property will override the public event property.
213
+
214
+ #### 3.3 Enable Auto-tracking
215
+
216
+ Auto-tracking can be enabled by calling configuration initialization parameters:
217
+
218
+ ```
219
+ -- Enable auto-tracking
220
+ -- appInstall=Enable auto-tracking installation event
221
+ -- appStart=Enable auto-tracking start event
222
+ -- appEnd=Enable auto-tracking end event
223
+ local params = {
224
+ appId = "YOUR_APP_ID",
225
+ serverUrl = "YOUR_SERVER_URL",
226
+ autoTrack = {
227
+ "appStart", "appEnd", "appInstall"
228
+ }
229
+ }
230
+ TDAnalytics.init( params )
231
+ ```
232
+
233
+ <!-- unsupported block: 34 -->
234
+
235
+ Note: If you need to customize the visitor ID, please be sure to call the `identify()` interface to set the visitor ID before enabling the auto-tracking feature.
236
+
237
+ #### 3.4 Send Event
238
+
239
+ It is recommended that you set event properties and conditions for sending information based on your previously documented tracking plan. The event name is a `string` type, can only start with a letter, can contain numbers, letters and underscores "\_", maximum length 50 characters, case-insensitive.
240
+
241
+ ```
242
+ TDAnalytics.track( "product_buy", {
243
+ product_name="Product Name"
244
+ });
245
+ ```
246
+
247
+ - Event properties are of `table` type, where each element represents a property;
248
+ - Event property `Key` is the property name, is a `string` type, can only start with a letter, contain numbers, letters and underscores "\_", maximum length 50 characters, case-insensitive;
249
+ - Property values support six types: string, numeric, `bool`, `Array`, object, and object array.
250
+ Complex data types, properties can pass objects and object arrays:
251
+
252
+ #### 3.5 Set User Properties
253
+
254
+ 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.
255
+
256
+ ```
257
+ -- Set user properties
258
+ TDAnalytics.userSet({
259
+ user_name = "TE"
260
+ })
261
+ ```
262
+
263
+ <!-- unsupported block: 34 -->
264
+
265
+ Property format requirements are the same as event properties.
266
+
267
+ ### IV. Best Practices
268
+
269
+ The following example code includes all the above operations. We recommend following these steps:
270
+
271
+ ```
272
+ -- Import TDAnalytics
273
+ local TDAnalytics = require("TDAnalytics")
274
+
275
+ if (Privacy Policy Authorization) {
276
+ -- Initialize SDK
277
+ local params = {
278
+ appId = "YOUR_APP_ID",
279
+ serverUrl = "YOUR_SERVER_URL"
280
+ }
281
+ TDAnalytics.init(params)
282
+
283
+ --If the user has logged in, you can set the user's account ID as the unique identifier
284
+ TDAnalytics.login("TA")
285
+
286
+ --After setting public event properties, every event will have public event properties
287
+ local superProperties = {}
288
+ superProperties["channel"] = "ta" -- string
289
+ superProperties["age"] = 1 -- number
290
+ superProperties["isSuccess"] = true -- boolean
291
+ superProperties["birthday"] = os.date("%Y-%m-%d %H:%M:%S") -- time
292
+ superProperties["object"] = { key="value" } -- object
293
+ superProperties["object_arr"] = { { key="value" } } -- object array
294
+ superProperties["arr"] = { "value" } -- array
295
+ TDAnalytics.setSuperProperties(superProperties) -- Set public event properties
296
+
297
+ --Send event
298
+ TDAnalytics.track("product_buy", {
299
+ product_name="Product Name"
300
+ });
301
+
302
+ --Set user properties
303
+ TDAnalytics.userSet({
304
+ user_name = "TE"
305
+ })
306
+ }
307
+ ```
308
+
309
+ ---
310
+
311
+ # Advanced Guide
312
+
313
+ ### I. Set User ID
314
+
315
+ 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 App or changes the device.
316
+
317
+ #### 1.1 Set Visitor ID
318
+
319
+ ::: tip Note
320
+
321
+ Generally, you do not need to customize the visitor ID. Please ensure you understand the user identification rules before setting the visitor ID.
322
+
323
+ 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.
324
+
325
+ :::
326
+
327
+ If your game has its own visitor ID management system for each user, you can call `setDistinctId` to set the visitor ID:
328
+
329
+ ```
330
+ -- Set the visitor ID to "Thinker"
331
+ TDAnalytics.setDistinctId("Thinker");
332
+ ```
333
+
334
+ If you need to get the current visitor ID, you can call `getDistinctId`:
335
+
336
+ ```
337
+ --Return visitor ID
338
+ TDAnalytics.getDistinctId( function (ret)
339
+ print( "distinctId = " .. ret )
340
+ end )
341
+ ```
342
+
343
+ #### 1.2 Set Account ID
344
+
345
+ 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.
346
+
347
+ ```
348
+ --The user's unique login identifier, this data corresponds to #account_id in the reported data, at this time #account_id is "TA"
349
+ TDAnalytics.login("TA");
350
+ ```
351
+
352
+ <!-- unsupported block: 34 -->
353
+
354
+ **This method will not upload a login event**
355
+
356
+ #### 1.3 Clear Account ID
357
+
358
+ 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.
359
+
360
+ ```
361
+ TDAnalytics.logout();
362
+ ```
363
+
364
+ 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.
365
+
366
+ <!-- unsupported block: 34 -->
367
+
368
+ **This method will not upload a logout event**
369
+
370
+ ### II. Send Events
371
+
372
+ 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.
373
+
374
+ #### 2.1 Ordinary Events
375
+
376
+ 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 plan. Here is an example of a user purchasing a product:
377
+
378
+ ```
379
+ local properties = {
380
+ product_name = "Product Name"
381
+ }
382
+ TDAnalytics.track("product_buy", properties)
383
+ ```
384
+
385
+ #### 2.2 First-time Event
386
+
387
+ 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.
388
+
389
+ ```
390
+ -- Example: Report device first-time event, assuming event name is device_activation
391
+ TDAnalytics.trackFirst("device_activation", {
392
+ test_string="first_string"
393
+ })
394
+ ```
395
+
396
+ 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:
397
+
398
+ ```
399
+ -- Set the user ID as the first_check_id of the first-time event to implement the collection of user first activation event
400
+ TDAnalytics.trackFirst("account_activation", {
401
+ test_string="first_string"
402
+ } , "TA")
403
+ ```
404
+
405
+ <!-- unsupported block: 34 -->
406
+
407
+ 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.
408
+
409
+ #### 2.3 Updatable Events
410
+
411
+ 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.
412
+
413
+ ```
414
+ -- Example: Report an event that can be updated, assuming the event name is UPDATABLE_EVENT
415
+ -- After reporting, the event property status is 3, price is 100
416
+ TDAnalytics.trackUpdate("UPDATABLE_EVENT", {
417
+ status = 3,
418
+ price = 100
419
+ }, "Update_EventId")
420
+
421
+ -- After reporting, the event property status is updated to 5, price remains unchanged
422
+ TDAnalytics.trackUpdate("UPDATABLE_EVENT", {
423
+ status = 5
424
+ }, "Update_EventId")
425
+ ```
426
+
427
+ #### 2.4 Overwritable Events
428
+
429
+ 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.
430
+
431
+ ```
432
+ -- Example: Report an event that can be overwritten, assuming the event name is OVERWRITABLE_EVENT
433
+ TDAnalytics.trackOverwrite("OVERWRITABLE_EVENT", {
434
+ status = 3,
435
+ price = 100
436
+ }, "Overwrite_EventId")
437
+
438
+ -- After reporting, the event property status is updated to 5, price property is deleted
439
+ TDAnalytics.trackOverwrite("OVERWRITABLE_EVENT", {
440
+ status = 5
441
+ }, "Overwrite_EventId")
442
+ ```
443
+
444
+ #### 2.5 Public Event Properties
445
+
446
+ Public event properties refer to properties that will be uploaded with every event. Based on the property update frequency, public event properties are divided into `static public event properties` and `dynamic public event properties`. You can choose different public event property setting methods according to your specific business scenario requirements; we recommend that you set public event properties before sending events. For the same event, when the Key of public event properties, event custom properties, and preset properties are the same, we will assign values according to the following priority: `Custom Properties > Dynamic Public Event Properties > Static Public Event Properties > Preset Properties`.
447
+
448
+ ##### 2.5.1 Static Public Event Properties
449
+
450
+ 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.
451
+
452
+ ```
453
+ -- Set public properties
454
+ TDAnalytics.setSuperProperties({
455
+ vip_level = 2
456
+ })
457
+ ```
458
+
459
+ 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 operate static public event properties to meet daily business needs.
460
+
461
+ ```
462
+ -- Clear the public property named trip
463
+ TDAnalytics.unsetSuperProperties("trip")
464
+ -- Clear all public properties
465
+ TDAnalytics.clearSuperProperties()
466
+ -- Get all public properties
467
+ TDAnalytics.getSuperProperties( function (ret)
468
+ local superProperties = ret
469
+ print( "current superProperties = " .. superProperties )
470
+ end )
471
+ ```
472
+
473
+ #### 2.6 Record Event Duration
474
+
475
+ 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.
476
+
477
+ ```
478
+ --The following example completes the statistics of the user's stay duration on a certain product page
479
+ -- User enters the product page, start timing
480
+ TDAnalytics.timeEvent("stay_shop")
481
+ -- do some thing...
482
+ -- User leaves the product page, timing ends, the "stay_shop" event will have a property #duration representing the event duration
483
+ TDAnalytics.track("stay_shop")
484
+ ```
485
+
486
+ ### III. User Properties
487
+
488
+ The user property setting APIs supported by TE platform are: `userSet`, `userSetOnce`, `userAdd`, `userAppend`, `userUnset`, `userDelete`.
489
+
490
+ #### 3.1 userSet
491
+
492
+ 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
493
+
494
+ ```
495
+ -- At this time username is TA
496
+ TDAnalytics.userSet({
497
+ user_name = "TA"
498
+ })
499
+ -- At this time username is TE
500
+ TDAnalytics.userSet({
501
+ user_name = "TE"
502
+ })
503
+ ```
504
+
505
+ #### 3.2 userSetOnce
506
+
507
+ 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:
508
+
509
+ ```
510
+ --first_payment_time is 2018-01-01 01:23:45.678
511
+ TDAnalytics.userSetOnce({
512
+ first_payment_time = "2018-01-01 01:23:45.678"
513
+ })
514
+ -- first_payment_time is still 2018-01-01 01:23:45.678
515
+ TDAnalytics.userSetOnce({
516
+ first_payment_time = "2018-12-31 01:23:45.678"
517
+ })
518
+ ```
519
+
520
+ #### 3.3 userAdd
521
+
522
+ 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:
523
+
524
+ ```
525
+ -- At this time total_revenue is 30
526
+ TDAnalytics.userAdd({
527
+ total_revenue = 30
528
+ })
529
+ -- At this time total_revenue is 678
530
+ TDAnalytics.userAdd({
531
+ total_revenue = 648
532
+ })
533
+ ```
534
+
535
+ <!-- unsupported block: 34 -->
536
+
537
+ The property key is a string, and Value only allows numeric values.
538
+
539
+ #### 3.4 userAppend
540
+
541
+ You can call `userAppend` to append elements to `Array` type user properties:
542
+
543
+ ```
544
+ -- Append list type user properties
545
+ TDAnalytics.userAppend({
546
+ weapon = {"m41", "bulldog"}
547
+ })
548
+ ```
549
+
550
+ #### 3.5 userUnset
551
+
552
+ 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 type parameters:
553
+
554
+ ```
555
+ -- Clear specified user property
556
+ TDAnalytics.userUnset("age")
557
+ ```
558
+
559
+ <!-- unsupported block: 34 -->
560
+
561
+ The passed value is the Key of the property to be cleared.
562
+
563
+ #### 3.6 userDelete
564
+
565
+ 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.
566
+
567
+ ```
568
+ -- Delete user
569
+ TDAnalytics.userDelete()
570
+ ```
571
+
572
+ ### IV. Other Features
573
+
574
+ #### 4.1 Get Device ID
575
+
576
+ After SDK initialization is complete, SDK will automatically generate a device ID and record it in local cache. For the same application or game, the device ID of one device is unchanged. You can call `getDeviceId` to get the device ID:
577
+
578
+ ```
579
+ -- Get Device ID
580
+ TDAnalytics.getDeviceId( function (ret)
581
+ print( "deviceId = " .. ret )
582
+ end )
583
+ ```
584
+
585
+ ---
586
+
587
+ # Real-time Debugging
588
+
589
+ #### I. Print SDK Logs
590
+
591
+ ```
592
+ -- Enable log printing
593
+ local params = {
594
+ appId = "YOUR_APP_ID",
595
+ serverUrl = "YOUR_SERVER_URL",
596
+ enableLog = true, -- true=Enable log printing, false=Disable log printing
597
+ }
598
+ TDAnalytics.init( params )
599
+ ```
600
+
601
+ <!-- unsupported block: 34 -->
602
+
603
+ After enabling logs, you can filter ThinkingData related logs in the IDE to observe SDK data reporting.
604
+
605
+ #### II. Enable Debug Mode
606
+
607
+ Enabling Debug mode requires the following two steps:
608
+
609
+ 1. Enable Debug mode on the client side
610
+ The following is an example code for enabling Debug mode on the client side:
611
+
612
+ ```
613
+ --[[
614
+ Set the running mode to Debug mode
615
+ normal mode: Data will be stored in cache and reported according to a certain cache strategy. Default is NORMAL mode; recommended for production environment
616
+ debug mode: Data is reported one by one. When problems occur, users will be prompted with logs and exceptions; not recommended for production environment
617
+ debugOnly mode: Only validates data, will not be stored in database; not recommended for production environment
618
+ ]]--
619
+ local params = {
620
+ appId = "YOUR_APP_ID",
621
+ serverUrl = "YOUR_SERVER_URL",
622
+ debugMode = "debug", -- normal, debug, debugOnly
623
+ }
624
+ TDAnalytics.init( params )
625
+ ```
626
+
627
+ 1. Add Debug device in TE backend
628
+ 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.
629
+
630
+ Device ID can be obtained through the following three ways:
631
+
632
+ - The #device_id property in event data in TE platform
633
+ - Client logs: SDK will print device DeviceId after initialization completes
634
+ - Through instance interface call: Get Device ID
635
+ <!-- unsupported block: 34 -->
636
+
637
+ 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.
638
+
639
+ ---
640
+
641
+ # Auto-tracking
642
+
643
+ TDAnalytics SDK provides auto-tracking for three types of events:
644
+
645
+ - `appInstall`: Game installation, this event will be collected when the game is first opened after installation (event name `ta_app_install`)
646
+ - `appStart`: This event will be collected when the game enters foreground (event name `ta_app_start`)
647
+ - `appEnd`: This event will be collected when the game exits to background (event name `ta_app_end`)
648
+ Auto-tracking can be enabled by calling configuration initialization parameters:
649
+
650
+ ```
651
+ -- Enable auto-tracking
652
+ -- appInstall=Enable auto-tracking installation event
653
+ -- appStart=Enable auto-tracking start event
654
+ -- appEnd=Enable auto-tracking end event
655
+ local params = {
656
+ appId = "YOUR_APP_ID",
657
+ serverUrl = "YOUR_SERVER_URL",
658
+ autoTrack = {
659
+ "appStart", "appEnd", "appInstall"
660
+ }
661
+ }
662
+ TDAnalytics.init( params )
663
+ ```
664
+
665
+ <!-- unsupported block: 34 -->
666
+
667
+ Note: If you need to customize the visitor ID, please be sure to call the `setDistinctId` interface to set the visitor ID before enabling the auto-tracking feature.
668
+
669
+ ###
670
+
671
+ ---
672
+
673
+ # Preset Properties
674
+
675
+ #### I. Preset Properties Description
676
+
677
+ <!-- unsupported block: 34 -->
678
+
679
+ Preset properties collected by each platform will have certain differences. For details, please refer to the following documents: Android Platform, iOS Platform
680
+
681
+ #### II. Get Preset Properties
682
+
683
+ When server-side tracking needs some preset properties from the App side, you can get the preset properties from the App side through this method and pass them to the server side.
684
+
685
+ ```
686
+ -- Get property object
687
+ TDAnalytics.getPresetProperties( function (ret)
688
+ local presetProperties = ret
689
+ print( "current presetProperties = " .. presetProperties )
690
+ end )
691
+ --[[
692
+ {
693
+ "#carrier": "China Telecom", -- Mobile SIM card carrier information, for dual SIM dual standby, take the main card's carrier information
694
+ "#os": "Android", -- System type, such as Android/iOS
695
+ "#device_id": "abb8e87bfb5ce66c", -- Device unique identifier
696
+ "#screen_height": 2264, -- Screen height
697
+ "#bundle_id": "com.sw.thinkingdatademo", -- Package name
698
+ "#manufacturer": "realme", -- Mobile manufacturer, such as HuaWei
699
+ "#device_model": "RMX1991", -- Device model
700
+ "#screen_width": 1080, -- Screen width
701
+ "#system_language": "zh", -- Mobile system language type
702
+ "#os_version": "10", -- System version number
703
+ "#network_type": "WIFI", -- Network type
704
+ "#zone_offset": 8, -- Timezone offset value
705
+ "#app_version":"1.0" -- app version number
706
+ }
707
+ ]]--
708
+ ```
709
+
710
+ <!-- unsupported block: 34 -->
711
+
712
+ IP, country and city information are generated by server-side analysis, client does not provide interface to get these properties
713
+
714
+ ###