@thinkingai/ae-cli 6.1.29 → 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.
- package/README.md +11 -5
- package/README.zh.md +11 -5
- package/bin/ai-monitor.js +2 -0
- package/dist/ai-monitor-MKMHSSNI.js +32 -0
- package/dist/ai-monitor.js +135 -0
- package/dist/{auth-OBQ5KVQM.js → auth-CZHHPZOQ.js} +12 -11
- package/dist/{automation-NAR5DDGL.js → automation-FLCPFMN4.js} +5 -5
- package/dist/{capability-LFSVNI5B.js → capability-64KVJFIA.js} +28 -32
- package/dist/{chunk-IN7KKL6K.js → chunk-2F64AZYH.js} +1 -1
- package/dist/{chunk-QZLRHGVH.js → chunk-3ULDJJTZ.js} +1 -1
- package/dist/{chunk-JNVVJ273.js → chunk-4PSTYEG5.js} +5 -10
- package/dist/{chunk-3SDHJOCR.js → chunk-4XKTRCRK.js} +16 -16
- package/dist/{chunk-RJHGDWSC.js → chunk-5M5LBRR3.js} +2 -2
- package/dist/chunk-6M7ZEDT2.js +182 -0
- package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
- package/dist/chunk-BNBCMCYN.js +563 -0
- package/dist/chunk-CF6JTT2U.js +64 -0
- package/dist/{chunk-2UW3Y463.js → chunk-DWBYNGSR.js} +565 -315
- package/dist/{chunk-N6XBLRB7.js → chunk-F2VFZUGG.js} +2 -2
- package/dist/{chunk-CVCTFLSO.js → chunk-FCAA7I2D.js} +3 -3
- package/dist/{chunk-H3K5UGYC.js → chunk-HTZ2MLYA.js} +48 -22
- package/dist/{chunk-QZUVLFNR.js → chunk-HVMCPKOZ.js} +1 -1
- package/dist/chunk-IDDWEZ7F.js +1285 -0
- package/dist/{chunk-7JAVT5TK.js → chunk-KTJXD27G.js} +2 -2
- package/dist/{chunk-6HAUVWOQ.js → chunk-NLEXY2TM.js} +48 -13
- package/dist/{chunk-YVG6QD3V.js → chunk-P7QDCWJ6.js} +98 -7
- package/dist/{chunk-PWXDWMCW.js → chunk-T7WF4HYW.js} +84 -32
- package/dist/{chunk-VCZE3IWO.js → chunk-TMQGS4TO.js} +15 -10
- package/dist/{compat-check-CII6B74E.js → compat-check-ZJNCMNQV.js} +3 -3
- package/dist/{config-YZ6O2UQ2.js → config-FSH2NMNZ.js} +26 -13
- package/dist/{context-F6FCGTF3.js → context-YAQG6YQC.js} +3 -3
- package/dist/{data-integration-6UAZO4GG.js → data-integration-QE37EQ3A.js} +1 -1
- package/dist/{evaluation-4LO2O4AF.js → evaluation-2JSF4V47.js} +13 -158
- package/dist/index.js +84 -586
- package/dist/{memory-HHPX3NF2.js → memory-VEZZVAAP.js} +5 -5
- package/dist/{metadata-TIFY24LW.js → metadata-3IWHX3V4.js} +8 -8
- package/dist/{model-7UHGWYVR.js → model-T7H7Q6BG.js} +3 -3
- package/dist/{personal-semantic-preference-WKJEGPTM.js → personal-semantic-preference-YITU23SA.js} +7 -7
- package/dist/{project-semantic-EIQVZNHW.js → project-semantic-MHEXJF3C.js} +16 -14
- package/dist/{sync-RV3OPCTI.js → sync-AQHVCSPI.js} +5 -5
- package/dist/{te-agent-5ENVZJUH.js → te-agent-RXI7WOH4.js} +6 -6
- package/dist/{te-analysis-USIK6ZZG.js → te-analysis-CZY74HVF.js} +381 -192
- package/dist/{te-community-WE2UU4XV.js → te-community-DKCYUBCM.js} +7 -7
- package/dist/{te-dataops-XNMO7MBF.js → te-dataops-QEH6VE56.js} +5 -5
- package/dist/{te-engage-6C3HCFQR.js → te-engage-WK7WKDKF.js} +7 -7
- package/dist/{te-experiment-LVTRI3QK.js → te-experiment-LH3RPIOE.js} +275 -30
- package/dist/{te-kb-TUPGMVBY.js → te-kb-UPORIOVN.js} +17 -8
- package/dist/{te-system-YM657FKO.js → te-system-AL4B4XZL.js} +3 -3
- package/dist/{te-team-G4VEJJNL.js → te-team-LLVTO2G4.js} +6 -6
- package/dist/{things-22KQWC23.js → things-XLMLBYQR.js} +6 -6
- package/dist/{update-XX4ILU7X.js → update-7J5UQHSK.js} +4 -4
- package/dist/{workspace-LYDAP647.js → workspace-FF2HXJGR.js} +5 -5
- package/package.json +9 -7
- package/skills/ae-ai-monitor/SKILL.md +179 -0
- package/skills/ae-ai-monitor/references/read-commands.md +866 -0
- package/skills/ae-analysis/SKILL.md +10 -4
- package/skills/ae-analysis/references/adhoc_export.md +3 -1
- package/skills/ae-analysis/references/ai_models/path.md +5 -6
- package/skills/ae-analysis/references/ai_models.md +1 -0
- package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
- package/skills/ae-analysis/references/asset_search.md +1 -1
- package/skills/ae-analysis/references/bad_case_begin.md +12 -0
- package/skills/ae-analysis/references/bad_case_get.md +12 -0
- package/skills/ae-analysis/references/bad_case_history.md +12 -0
- package/skills/ae-analysis/references/bad_case_list.md +12 -0
- package/skills/ae-analysis/references/bad_case_review.md +51 -0
- package/skills/ae-analysis/references/bad_case_run.md +12 -0
- package/skills/ae-analysis/references/bad_case_submit.md +12 -0
- package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
- package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
- package/skills/ae-analysis/references/bi_panel_list.md +1 -1
- package/skills/ae-analysis/references/bi_panel_share.md +3 -1
- package/skills/ae-analysis/references/catalog_list.md +2 -0
- package/skills/ae-analysis/references/command_index.md +38 -29
- package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
- package/skills/ae-analysis/references/dashboard_handover.md +3 -1
- package/skills/ae-analysis/references/dashboard_list.md +3 -3
- package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
- package/skills/ae-analysis/references/dashboard_share.md +3 -1
- package/skills/ae-analysis/references/dashboard_update.md +3 -2
- package/skills/ae-analysis/references/filter_value_list.md +2 -0
- package/skills/ae-analysis/references/folder_share.md +8 -2
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
- package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
- package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
- package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
- package/skills/ae-analysis/references/project_member_add.md +3 -1
- package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
- package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
- package/skills/ae-analysis/references/project_member_update.md +3 -1
- package/skills/ae-analysis/references/project_owner_update.md +3 -1
- package/skills/ae-analysis/references/project_role_upsert.md +5 -3
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
- package/skills/ae-analysis/references/project_space_share.md +8 -2
- package/skills/ae-analysis/references/property_get.md +2 -0
- package/skills/ae-analysis/references/public_link_list.md +3 -1
- package/skills/ae-analysis/references/query_cancel.md +4 -1
- package/skills/ae-analysis/references/report_data_run.md +1 -1
- package/skills/ae-analysis/references/report_list.md +3 -3
- package/skills/ae-analysis/references/scenario_append.md +2 -2
- package/skills/ae-analysis/references/scenario_collect.md +15 -4
- package/skills/ae-analysis/references/scenario_list.md +2 -1
- package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
- package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
- package/skills/ae-analysis/references/user_tag_create.md +4 -1
- package/skills/ae-analysis/references/user_tag_get.md +2 -0
- package/skills/ae-analysis/references/user_tag_models.md +8 -2
- package/skills/ae-analysis/references/user_tag_update.md +5 -2
- package/skills/ae-analysis/references/virtual_property_create.md +12 -1
- package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
- package/skills/ae-automation/SKILL.md +4 -2
- package/skills/ae-capability/SKILL.md +9 -5
- package/skills/ae-community/SKILL.md +1 -0
- package/skills/ae-dataops/SKILL.md +1 -0
- package/skills/ae-engage/SKILL.md +1 -0
- package/skills/ae-evaluation/SKILL.md +17 -2
- package/skills/ae-experiment/SKILL.md +38 -11
- package/skills/ae-experiment/references/experiment_approval.md +171 -0
- package/skills/ae-experiment/references/manage_experiment.md +11 -2
- package/skills/ae-experiment/references/save_experiment.md +28 -8
- package/skills/ae-experiment/references/save_submit_experiment.md +18 -3
- package/skills/ae-experiment/references/save_submit_external_experiment.md +57 -3
- package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
- package/skills/ae-kb/SKILL.md +9 -5
- package/skills/ae-kb/references/analysis-workflow.md +11 -2
- package/skills/ae-kb/references/query-workflow.md +9 -6
- package/skills/ae-kb/references/versions.md +1 -1
- package/skills/ae-kb-discovery/SKILL.md +15 -6
- package/skills/ae-metadata/SKILL.md +1 -0
- package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
- package/skills/ae-team/SKILL.md +1 -1
- package/skills/ae-tracking-matrix/SKILL.md +170 -0
- package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
- package/skills/ae-tracking-matrix/i18n.yaml +12 -0
- package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
- package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
- package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
- package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
- package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
- package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
- package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
- package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
- package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
- package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
- package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
- package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
- package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
- package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
- package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
- package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
- package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
- package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
- package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
- package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
- package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
- package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
- package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
- package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
- package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
- package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
- package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
- package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
- package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
- package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
- package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
- package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
- package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
- package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
- package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
- package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
- package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
- package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
- package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
- package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
- package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
- package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
- package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
- package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
- package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
- package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
- package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
- package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
- package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
- package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
- package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
- package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
- package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
- package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
- package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
- package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
- package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
- package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
- package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
- package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
- package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
- package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
- package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
- package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
- package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
- package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
- package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
- package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
- package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
- package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
- package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
- package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
- package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
- package/dist/chunk-AMBFK2K3.js +0 -28
|
@@ -0,0 +1,655 @@
|
|
|
1
|
+
---
|
|
2
|
+
code: cocos2d_lua_sdk_installation
|
|
3
|
+
name: "Cocos2d-Lua"
|
|
4
|
+
wikiToken: QmTDwzv5mi9NVekISpKcwfJNnRc
|
|
5
|
+
parentWikiToken: BAU2w0eipiqGnckeUsIc0mYQnZc
|
|
6
|
+
updateTime: 1745310884000
|
|
7
|
+
sourceUrl: https://docs-v2.thinkingdata.cn/?version=6.0&lan=zh-CN&code=cocos2d_lua_sdk_installation
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Cocos2d-Lua
|
|
11
|
+
|
|
12
|
+
::: tip Note
|
|
13
|
+
|
|
14
|
+
Before integration, please read the Pre-installation Guide first.
|
|
15
|
+
|
|
16
|
+
Cocos2d-Lua SDK supports running on iOS and Android platforms, size approximately 7.1M
|
|
17
|
+
|
|
18
|
+
:::
|
|
19
|
+
|
|
20
|
+
**Latest Version:** v2.0.2
|
|
21
|
+
|
|
22
|
+
**Update Time:** 2024-01-19
|
|
23
|
+
|
|
24
|
+
**Resource Download:** Source Code, SDK Download
|
|
25
|
+
|
|
26
|
+
::: warning Warning
|
|
27
|
+
|
|
28
|
+
This document applies to v2.0.0 and later versions, for historical versions please refer to Cocos2d-Lua Integration Guide (V1), SDK Download (v1.0.1)
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
### I. Integrate SDK
|
|
33
|
+
|
|
34
|
+
- **Add Cocos2d-Lua Configuration**
|
|
35
|
+
- Download Cocos2d-Lua SDK resource files, unzip the files and add `TDAnalytics.lua` to the `src` folder
|
|
36
|
+
- **Add Android Configuration**
|
|
37
|
+
- Create a `libs` folder in `frameworks/runtime-src/proj.android/app` directory, and add `TDAnalytics.aar` and `TDCore.aar` to the `libs` folder
|
|
38
|
+
- Add `TDAnalyticsProxy.java` in `frameworks/runtime-src/proj.android/app/src/org/cocos2dx/lua` directory
|
|
39
|
+
- Add the following configuration in `CMakeLists.txt`
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
if(ANDROID)
|
|
43
|
+
list(APPEND GAME_SOURCE
|
|
44
|
+
# ... Add the following code
|
|
45
|
+
${RUNTIME_SRC_ROOT}/proj.android/app/src/org/cocos2dx/lua/TDAnalyticsProxy.java
|
|
46
|
+
${RUNTIME_SRC_ROOT}/proj.android/app/libs/TDCore.aar
|
|
47
|
+
${RUNTIME_SRC_ROOT}/proj.android/app/libs/TDAnalytics.aar
|
|
48
|
+
)
|
|
49
|
+
endif()
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- Add the following configuration in `build.gradle` under `frameworks/runtime-src/proj.android/app` directory
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
dependencies {
|
|
56
|
+
// Add .aar reference
|
|
57
|
+
implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- **Add iOS Configuration (Cocos2d-Lua-Community 4.x)**
|
|
62
|
+
- Add `TDAnalyticsProxy.h`, `TDAnalyticsProxy.mm`, and `ThinkingSDK.framework` to `frameworks/runtime-src/proj.ios_mac/ios` directory
|
|
63
|
+
- Add the following configuration in `CMakeLists.txt`
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
if(APPLE)
|
|
67
|
+
if(IOS)
|
|
68
|
+
list(APPEND GAME_HEADER
|
|
69
|
+
# [TDAnalytics] Add the following code
|
|
70
|
+
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/TDAnalyticsProxy.h
|
|
71
|
+
)
|
|
72
|
+
list(APPEND GAME_SOURCE
|
|
73
|
+
# [TDAnalytics] Add the following code
|
|
74
|
+
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/TDAnalyticsProxy.mm
|
|
75
|
+
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/ThinkingSDK.framework
|
|
76
|
+
)
|
|
77
|
+
endif()
|
|
78
|
+
endif()
|
|
79
|
+
|
|
80
|
+
if(IOS)
|
|
81
|
+
# [TDAnalytics] Add the following code
|
|
82
|
+
target_link_libraries(${APP_NAME} ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/ThinkingSDK.framework)
|
|
83
|
+
endif()
|
|
84
|
+
|
|
85
|
+
if(IOS)
|
|
86
|
+
# [TDAnalytics] Add the following code
|
|
87
|
+
set(CMAKE_EXE_LINKER_FLAGS -ObjC)
|
|
88
|
+
endif()
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- **Add iOS Configuration (Cocos2d-Lua-Community 3.x)**
|
|
92
|
+
- Open `iOS` project with Xcode, directly drag and drop the `iOS` folder from the SDK directory into the `Classes` directory
|
|
93
|
+
- Add `-force_load "$(SRCROOT)/ios/ThinkingSDK.framework/ThinkingSDK"` for both `Debug` and `Release` in `Build Setting` -> `Other Linker Flags`
|
|
94
|
+
|
|
95
|
+
### II. Initialization
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
local TDAnalytics = require("TDAnalytics")
|
|
99
|
+
TDAnalytics.init(APPID, SERVER_URL, TDAnalytics.debugModel.debugOff)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Parameter description:
|
|
103
|
+
|
|
104
|
+
- `APPID`: Your project's APPID, can be obtained from TE backend project management page
|
|
105
|
+
- `SERVER_URL`: URL for data upload
|
|
106
|
+
- If you are connecting to cloud service, enter: https://global-receiver-ta.thinkingdata.cn
|
|
107
|
+
- If you are using a privately deployed version, please bind a domain name for the data collection address and configure HTTPS certificate: https://your-data-collection-domain
|
|
108
|
+
<!-- unsupported block: 34 -->
|
|
109
|
+
|
|
110
|
+
Since Android 9.0+ restricts HTTP requests by default, please use HTTPS protocol
|
|
111
|
+
|
|
112
|
+
### III. Common Features
|
|
113
|
+
|
|
114
|
+
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.
|
|
115
|
+
|
|
116
|
+
#### 3.1 Set Account ID
|
|
117
|
+
|
|
118
|
+
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.
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
--The user's unique login identifier, this data corresponds to #account_id in the reported data, at this time #account_id is "TA"
|
|
122
|
+
TDAnalytics.login("TA")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`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.
|
|
126
|
+
|
|
127
|
+
<!-- unsupported block: 34 -->
|
|
128
|
+
|
|
129
|
+
**This method will not upload a login event**
|
|
130
|
+
|
|
131
|
+
#### 3.2 Set Public Event Properties
|
|
132
|
+
|
|
133
|
+
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. For some important properties, such as user membership level, source channel, etc., these properties need to be set in every event, you can set these properties as public event properties.
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
local superProperties = {}
|
|
137
|
+
superProperties["channel"] = "ta" -- string
|
|
138
|
+
superProperties["age"] = 1 -- number
|
|
139
|
+
superProperties["isSuccess"] = true -- boolean
|
|
140
|
+
superProperties["birthday"] = os.date("%Y-%m-%d %H:%M:%S") -- time
|
|
141
|
+
superProperties["object"] = { key="value" } -- object
|
|
142
|
+
superProperties["object_arr"] = { { key="value" } } -- object array
|
|
143
|
+
superProperties["arr"] = { "value" } -- array
|
|
144
|
+
TDAnalytics.setSuperProperties(superProperties) -- Set public event properties
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
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.
|
|
148
|
+
|
|
149
|
+
- 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, TE will uniformly convert to lowercase letters
|
|
150
|
+
- Value is the property value, supports string, number, boolean, time, object, object array, array
|
|
151
|
+
<!-- unsupported block: 34 -->
|
|
152
|
+
|
|
153
|
+
**Event properties and user properties requirements are the same as public event properties**
|
|
154
|
+
|
|
155
|
+
#### 3.3 Enable Auto-tracking
|
|
156
|
+
|
|
157
|
+
The following code example enables installation, start, and end events. If you want to learn more about SDK's auto-tracking capabilities, you can view the Auto-tracking Feature Introduction
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
TDAnalytics.enableAutoTrack( {
|
|
161
|
+
appInstall = true,
|
|
162
|
+
appStart = true,
|
|
163
|
+
appEnd = true
|
|
164
|
+
});
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### 3.4 Send Event
|
|
168
|
+
|
|
169
|
+
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 plan. Here is an example of a user purchasing a product:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
TDAnalytics.track("product_buy", {
|
|
173
|
+
product_name="Product Name"
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The event name is a string type, can only start with a letter, can contain numbers, letters and underscores "\_", maximum length 50 characters.
|
|
178
|
+
|
|
179
|
+
#### 3.5 Set User Properties
|
|
180
|
+
|
|
181
|
+
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:
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
-- At this time username is TA
|
|
185
|
+
TDAnalytics.userSet({
|
|
186
|
+
user_name = "TA"
|
|
187
|
+
})
|
|
188
|
+
-- At this time username is TE
|
|
189
|
+
TDAnalytics.userSet({
|
|
190
|
+
user_name = "TE"
|
|
191
|
+
})
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### IV. Best Practices
|
|
195
|
+
|
|
196
|
+
The following example code includes all the above operations. We recommend following these steps:
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
-- Import TDAnalytics
|
|
200
|
+
local TDAnalytics = require("TDAnalytics")
|
|
201
|
+
|
|
202
|
+
if (Privacy Policy Authorization) {
|
|
203
|
+
-- Initialize SDK
|
|
204
|
+
TDAnalytics.init(APP_ID, SERVER_URL, TDAnalytics.debugModel.debugOff);
|
|
205
|
+
--Enable auto-tracking events
|
|
206
|
+
TDAnalytics.enableAutoTrack( {
|
|
207
|
+
appInstall = true,
|
|
208
|
+
appStart = true,
|
|
209
|
+
appEnd = true
|
|
210
|
+
});
|
|
211
|
+
--If the user has logged in, you can set the user's account ID as the unique identifier
|
|
212
|
+
TDAnalytics.login("TA")
|
|
213
|
+
|
|
214
|
+
--After setting public event properties, every event will have public event properties
|
|
215
|
+
local superProperties = {}
|
|
216
|
+
superProperties["channel"] = "ta" -- string
|
|
217
|
+
superProperties["age"] = 1 -- number
|
|
218
|
+
superProperties["isSuccess"] = true -- boolean
|
|
219
|
+
superProperties["birthday"] = os.date("%Y-%m-%d %H:%M:%S") -- time
|
|
220
|
+
superProperties["object"] = { key="value" } -- object
|
|
221
|
+
superProperties["object_arr"] = { { key="value" } } -- object array
|
|
222
|
+
superProperties["arr"] = { "value" } -- array
|
|
223
|
+
TDAnalytics.setSuperProperties(superProperties) -- Set public event properties
|
|
224
|
+
|
|
225
|
+
--Send event
|
|
226
|
+
TDAnalytics.track("product_buy", {
|
|
227
|
+
product_name="Product Name"
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
--Set user properties
|
|
231
|
+
TDAnalytics.userSet({
|
|
232
|
+
user_name = "TE"
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
###
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
# Advanced Guide
|
|
242
|
+
|
|
243
|
+
### I. Set User ID
|
|
244
|
+
|
|
245
|
+
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.
|
|
246
|
+
|
|
247
|
+
#### 1.1 Set Visitor ID
|
|
248
|
+
|
|
249
|
+
::: tip Note
|
|
250
|
+
|
|
251
|
+
Generally, you do not need to customize the visitor ID. Please ensure you understand the user identification rules before setting the visitor ID.
|
|
252
|
+
|
|
253
|
+
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.
|
|
254
|
+
|
|
255
|
+
:::
|
|
256
|
+
|
|
257
|
+
If your game has its own visitor ID management system for each user, you can call `setDistinctId` to set the visitor ID:
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
// Set the visitor ID to "Thinker"
|
|
261
|
+
TDAnalytics.setDistinctId("Thinker");
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
If you need to get the current visitor ID, you can call `getDistinctId`:
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
//Return visitor ID
|
|
268
|
+
local distinctId = TDAnalytics.getDistinctId();
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
#### 1.2 Set Account ID
|
|
272
|
+
|
|
273
|
+
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.
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
--The user's unique login identifier, this data corresponds to #account_id in the reported data, at this time #account_id is "TA"
|
|
277
|
+
TDAnalytics.login("TA");
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
<!-- unsupported block: 34 -->
|
|
281
|
+
|
|
282
|
+
**This method will not upload a login event**
|
|
283
|
+
|
|
284
|
+
#### 1.3 Clear Account ID
|
|
285
|
+
|
|
286
|
+
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.
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
TDAnalytics.logout();
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
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.
|
|
293
|
+
|
|
294
|
+
<!-- unsupported block: 34 -->
|
|
295
|
+
|
|
296
|
+
**This method will not upload a logout event**
|
|
297
|
+
|
|
298
|
+
### II. Send Events
|
|
299
|
+
|
|
300
|
+
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.
|
|
301
|
+
|
|
302
|
+
#### 2.1 Ordinary Events
|
|
303
|
+
|
|
304
|
+
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:
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
local properties = {
|
|
308
|
+
product_name = "Product Name"
|
|
309
|
+
}
|
|
310
|
+
TDAnalytics.track("product_buy", properties)
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
#### 2.2 First-time Event
|
|
314
|
+
|
|
315
|
+
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.
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
-- Example: Report device first-time event, assuming event name is device_activation
|
|
319
|
+
TDAnalytics.trackFirst("device_activation", nil, {
|
|
320
|
+
test_string="first_string"
|
|
321
|
+
})
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
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:
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
-- Set the user ID as the first_check_id of the first-time event to implement the collection of user first activation event
|
|
328
|
+
TDAnalytics.trackFirst("account_activation", "TA", {
|
|
329
|
+
test_string="first_string"
|
|
330
|
+
})
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
<!-- unsupported block: 34 -->
|
|
334
|
+
|
|
335
|
+
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.
|
|
336
|
+
|
|
337
|
+
#### 2.3 Updatable Events
|
|
338
|
+
|
|
339
|
+
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.
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
-- Example: Report an event that can be updated, assuming the event name is UPDATABLE_EVENT
|
|
343
|
+
-- After reporting, the event property status is 3, price is 100
|
|
344
|
+
TDAnalytics.trackUpdate("UPDATABLE_EVENT", "Update_EventId", {
|
|
345
|
+
status = 3,
|
|
346
|
+
price = 100
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
-- After reporting, the event property status is updated to 5, price remains unchanged
|
|
350
|
+
TDAnalytics.trackUpdate("UPDATABLE_EVENT", "Update_EventId", {
|
|
351
|
+
status = 5
|
|
352
|
+
})
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
#### 2.4 Overwritable Events
|
|
356
|
+
|
|
357
|
+
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.
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
-- Example: Report an event that can be overwritten, assuming the event name is OVERWRITABLE_EVENT
|
|
361
|
+
TDAnalytics.trackOverwrite("OVERWRITABLE_EVENT", "Overwrite_EventId", {
|
|
362
|
+
status = 3,
|
|
363
|
+
price = 100
|
|
364
|
+
})
|
|
365
|
+
|
|
366
|
+
-- After reporting, the event property status is updated to 5, price property is deleted
|
|
367
|
+
TDAnalytics.trackOverwrite("OVERWRITABLE_EVENT", "Overwrite_EventId", {
|
|
368
|
+
status = 5
|
|
369
|
+
})
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
#### 2.5 Public Event Properties
|
|
373
|
+
|
|
374
|
+
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`.
|
|
375
|
+
|
|
376
|
+
##### 2.5.1 Static Public Event Properties
|
|
377
|
+
|
|
378
|
+
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.
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
-- Set public properties
|
|
382
|
+
TDAnalytics.setSuperProperties({
|
|
383
|
+
vip_level = 2
|
|
384
|
+
})
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
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.
|
|
388
|
+
|
|
389
|
+
```
|
|
390
|
+
-- Clear the public property named trip
|
|
391
|
+
TDAnalytics.unsetSuperProperty("trip")
|
|
392
|
+
-- Clear all public properties
|
|
393
|
+
TDAnalytics.clearSuperProperties()
|
|
394
|
+
-- Get all public properties
|
|
395
|
+
TDAnalytics.currentSuperProperties()
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
##### 2.5.2 Dynamic Public Event Properties
|
|
399
|
+
|
|
400
|
+
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 dynamic public event properties during event collection and add them to the triggered event.
|
|
401
|
+
|
|
402
|
+
```
|
|
403
|
+
local coin = 0;
|
|
404
|
+
local dynamicProperties = function()
|
|
405
|
+
coin++
|
|
406
|
+
local properties = { coin = coin }
|
|
407
|
+
return properties
|
|
408
|
+
end
|
|
409
|
+
TDAnalytics.setDynamicSuperProperties(dynamicProperties);
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### 2.6 Record Event Duration
|
|
413
|
+
|
|
414
|
+
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.
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
--The following example completes the statistics of the user's stay duration on a certain product page
|
|
418
|
+
-- User enters the product page, start timing
|
|
419
|
+
TDAnalytics.timeEvent("stay_shop")
|
|
420
|
+
-- do some thing...
|
|
421
|
+
-- User leaves the product page, timing ends, the "stay_shop" event will have a property #duration representing the event duration
|
|
422
|
+
TDAnalytics.track("stay_shop", {})
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### III. User Properties
|
|
426
|
+
|
|
427
|
+
The user property setting APIs supported by TE platform are: `userSet()`, `userSetOnce()`, `userAdd()`, `userAppend()`, `userUnset()`, `userDelete()`.
|
|
428
|
+
|
|
429
|
+
#### 3.1 userSet
|
|
430
|
+
|
|
431
|
+
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
|
|
432
|
+
|
|
433
|
+
```
|
|
434
|
+
-- At this time username is TA
|
|
435
|
+
TDAnalytics.userSet({
|
|
436
|
+
user_name = "TA"
|
|
437
|
+
})
|
|
438
|
+
-- At this time username is TE
|
|
439
|
+
TDAnalytics.userSet({
|
|
440
|
+
user_name = "TE"
|
|
441
|
+
})
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
#### 3.2 userSetOnce
|
|
445
|
+
|
|
446
|
+
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:
|
|
447
|
+
|
|
448
|
+
```
|
|
449
|
+
--first_payment_time is 2018-01-01 01:23:45.678
|
|
450
|
+
TDAnalytics.userSetOnce({
|
|
451
|
+
first_payment_time = "2018-01-01 01:23:45.678"
|
|
452
|
+
})
|
|
453
|
+
-- first_payment_time is still 2018-01-01 01:23:45.678
|
|
454
|
+
TDAnalytics.userSetOnce({
|
|
455
|
+
first_payment_time = "2018-12-31 01:23:45.678"
|
|
456
|
+
})
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
#### 3.3 userAdd
|
|
460
|
+
|
|
461
|
+
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:
|
|
462
|
+
|
|
463
|
+
```
|
|
464
|
+
-- At this time total_revenue is 30
|
|
465
|
+
TDAnalytics.userAdd({
|
|
466
|
+
total_revenue = 30
|
|
467
|
+
})
|
|
468
|
+
-- At this time total_revenue is 678
|
|
469
|
+
TDAnalytics.userAdd({
|
|
470
|
+
total_revenue = 648
|
|
471
|
+
})
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
<!-- unsupported block: 34 -->
|
|
475
|
+
|
|
476
|
+
The property key is a string, and Value only allows numeric values.
|
|
477
|
+
|
|
478
|
+
#### 3.4 userAppend
|
|
479
|
+
|
|
480
|
+
You can call `userAppend()` to append elements to `Array` type user properties:
|
|
481
|
+
|
|
482
|
+
```
|
|
483
|
+
-- Append list type user properties
|
|
484
|
+
TDAnalytics.userAppend({
|
|
485
|
+
weapon = {"m41", "bulldog"}
|
|
486
|
+
})
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
#### 3.5 userUnset
|
|
490
|
+
|
|
491
|
+
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:
|
|
492
|
+
|
|
493
|
+
```
|
|
494
|
+
-- Clear specified user property
|
|
495
|
+
TDAnalytics.userUnset("age")
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
<!-- unsupported block: 34 -->
|
|
499
|
+
|
|
500
|
+
The passed value is the Key of the property to be cleared.
|
|
501
|
+
|
|
502
|
+
#### 3.6 userDelete
|
|
503
|
+
|
|
504
|
+
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.
|
|
505
|
+
|
|
506
|
+
```
|
|
507
|
+
-- Delete user
|
|
508
|
+
TDAnalytics.userDelete()
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### IV. Other Features
|
|
512
|
+
|
|
513
|
+
#### 4.1 Get Device ID
|
|
514
|
+
|
|
515
|
+
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:
|
|
516
|
+
|
|
517
|
+
```
|
|
518
|
+
-- Get Device ID
|
|
519
|
+
TDAnalytics.getDeviceId()
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
# Real-time Debugging
|
|
525
|
+
|
|
526
|
+
#### I. Print SDK Logs
|
|
527
|
+
|
|
528
|
+
```
|
|
529
|
+
-- Enable log printing
|
|
530
|
+
-- logLevelNone: Log printing off
|
|
531
|
+
-- logLevelError: Print error logs
|
|
532
|
+
-- logLevelInfo: Print detailed logs
|
|
533
|
+
-- logLevelDebug: Print debug logs
|
|
534
|
+
TDAnalytics.setLogLevel(TDAnalytics.logLevel.logLevelDebug)
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
<!-- unsupported block: 34 -->
|
|
538
|
+
|
|
539
|
+
After enabling logs, you can filter ThinkingData related logs in the IDE to observe SDK data reporting.
|
|
540
|
+
|
|
541
|
+
#### II. Enable Debug Mode
|
|
542
|
+
|
|
543
|
+
Enabling Debug mode requires the following two steps:
|
|
544
|
+
|
|
545
|
+
1. Enable Debug mode on the client side
|
|
546
|
+
The following is an example code for enabling Debug mode on the client side:
|
|
547
|
+
|
|
548
|
+
```
|
|
549
|
+
--[[
|
|
550
|
+
Set the running mode to Debug mode
|
|
551
|
+
debugOff mode: Data will be stored in cache and reported according to a certain cache strategy. Default is NORMAL mode; recommended for production environment
|
|
552
|
+
debugOn mode: Data is reported one by one. When problems occur, users will be prompted with logs and exceptions; not recommended for production environment
|
|
553
|
+
debugOnly mode: Only validates data, will not be stored in database; not recommended for production environment
|
|
554
|
+
]]
|
|
555
|
+
TDAnalytics.init(APP_ID, SERVER_URL, TDAnalytics.debugModel.debugOn)
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
1. Add Debug device in TE backend
|
|
559
|
+
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.
|
|
560
|
+
|
|
561
|
+
Device ID can be obtained through the following three ways:
|
|
562
|
+
|
|
563
|
+
- The #device_id property in event data in TE platform
|
|
564
|
+
- Client logs: SDK will print device DeviceId after initialization completes
|
|
565
|
+
- Through instance interface call: Get Device ID
|
|
566
|
+
<!-- unsupported block: 34 -->
|
|
567
|
+
|
|
568
|
+
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.
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
# Auto-tracking
|
|
573
|
+
|
|
574
|
+
TDAnalytics SDK provides auto-tracking for three types of events:
|
|
575
|
+
|
|
576
|
+
- `appInstall`: Game installation, this event will be collected when the game is first opened after installation (event name `ta_app_install`)
|
|
577
|
+
- `appStart`: This event will be collected when the game enters foreground (event name `ta_app_start`)
|
|
578
|
+
- `appEnd`: This event will be collected when the game exits to background (event name `ta_app_end`)
|
|
579
|
+
Auto-tracking can be enabled by calling the `enableAutoTrack()` interface:
|
|
580
|
+
|
|
581
|
+
```
|
|
582
|
+
-- Enable auto-tracking Default false: off, true: on
|
|
583
|
+
local autoTack = {
|
|
584
|
+
appInstall = true, -- Enable auto-tracking installation event
|
|
585
|
+
appStart = true, -- Enable auto-tracking start event
|
|
586
|
+
appEnd = true -- Enable auto-tracking end event
|
|
587
|
+
}
|
|
588
|
+
TDAnalytics.enableAutoTrack(autoTack)
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
<!-- unsupported block: 34 -->
|
|
592
|
+
|
|
593
|
+
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.
|
|
594
|
+
|
|
595
|
+
###
|
|
596
|
+
|
|
597
|
+
---
|
|
598
|
+
|
|
599
|
+
# Preset Properties
|
|
600
|
+
|
|
601
|
+
#### I. Preset Properties Description
|
|
602
|
+
|
|
603
|
+
<!-- unsupported block: 34 -->
|
|
604
|
+
|
|
605
|
+
Preset properties collected by each platform will have certain differences. For details, please refer to the following documents: Android Platform, iOS Platform
|
|
606
|
+
|
|
607
|
+
#### II. Get Preset Properties
|
|
608
|
+
|
|
609
|
+
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.
|
|
610
|
+
|
|
611
|
+
```
|
|
612
|
+
-- Get property object
|
|
613
|
+
local presetProperties = TDAnalytics.getPresetProperties()
|
|
614
|
+
|
|
615
|
+
-- Generate event preset properties
|
|
616
|
+
local properties = presetProperties.toEventPresetProperties()
|
|
617
|
+
--[[
|
|
618
|
+
{
|
|
619
|
+
"#carrier": "China Telecom",
|
|
620
|
+
"#os": "Android",
|
|
621
|
+
"#device_id": "abb8e87bfb5ce66c",
|
|
622
|
+
"#screen_height": 2264,
|
|
623
|
+
"#bundle_id": "com.sw.thinkingdatademo",
|
|
624
|
+
"#manufacturer": "realme",
|
|
625
|
+
"#device_model": "RMX1991",
|
|
626
|
+
"#screen_width": 1080,
|
|
627
|
+
"#system_language": "zh",
|
|
628
|
+
"#os_version": "10",
|
|
629
|
+
"#network_type": "WIFI",
|
|
630
|
+
"#zone_offset": 8,
|
|
631
|
+
"#app_version":"1.0"
|
|
632
|
+
}
|
|
633
|
+
]]--
|
|
634
|
+
|
|
635
|
+
-- Get a specific preset property
|
|
636
|
+
local bundleId = presetProperties.bundleId -- Package name
|
|
637
|
+
local mOS = presetProperties.os -- System type, such as Android/iOS
|
|
638
|
+
local systemLanguage = presetProperties.systemLanguage -- Mobile system language type
|
|
639
|
+
local screenWidth = presetProperties.screenWidth -- Screen width
|
|
640
|
+
local screenHeight = presetProperties.screenHeight -- Screen height
|
|
641
|
+
local deviceModel = presetProperties.deviceModel -- Device model
|
|
642
|
+
local deviceId = presetProperties.deviceId -- Device unique identifier
|
|
643
|
+
local carrier = presetProperties.carrier -- Mobile SIM card carrier information, for dual SIM dual standby, take the main card's carrier information
|
|
644
|
+
local manufacture = presetProperties.manufacturer -- Mobile manufacturer, such as HuaWei
|
|
645
|
+
local networkType = presetProperties.networkType -- Network type
|
|
646
|
+
local osVersion = presetProperties.osVersion -- System version number
|
|
647
|
+
local appVersion = presetProperties.appVersion -- app version number
|
|
648
|
+
local zoneOffset = presetProperties.zoneOffset -- Timezone offset value
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
<!-- unsupported block: 34 -->
|
|
652
|
+
|
|
653
|
+
IP, country and city information are generated by server-side analysis, client does not provide interface to get these properties
|
|
654
|
+
|
|
655
|
+
###
|