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