@thinkingai/ae-cli 6.1.38 → 6.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/README.zh.md +2 -0
- package/dist/{ai-monitor-UL2O7J4X.js → ai-monitor-DST4NDOK.js} +5 -5
- package/dist/ai-monitor.js +7 -7
- package/dist/{auth-ERWVKQDG.js → auth-BD3NIY3T.js} +3 -3
- package/dist/{automation-OQ647CSW.js → automation-IMDCJUML.js} +85 -9
- package/dist/{capability-HPP6E3ZX.js → capability-3NJOQHZQ.js} +3 -3
- package/dist/{chunk-DKOGWIYQ.js → chunk-24DCOJBJ.js} +2 -2
- package/dist/{chunk-SHB7A2JE.js → chunk-2RORKIF6.js} +2 -2
- package/dist/{chunk-HBI7IQH3.js → chunk-6NJZSWUT.js} +3 -28
- package/dist/{chunk-QPUPWGZ3.js → chunk-DTODOQ6T.js} +1 -1
- package/dist/{chunk-PCQTBRPT.js → chunk-FRJUB66C.js} +1 -1
- package/dist/{chunk-ZLJZPPPV.js → chunk-IY5G42YY.js} +2 -2
- package/dist/{chunk-JRXSLFCA.js → chunk-KBJHBVO7.js} +1 -1
- package/dist/{chunk-CYZV5AXW.js → chunk-KE5WGBXS.js} +2 -1
- package/dist/chunk-N2MAYIRU.js +32 -0
- package/dist/{chunk-DULCIC67.js → chunk-SQEK6S4X.js} +2 -3
- package/dist/{chunk-VPLRZSMY.js → chunk-STHIGWWC.js} +10 -1
- package/dist/{chunk-BWEQIKA3.js → chunk-TVSGS5QB.js} +5 -5
- package/dist/{chunk-LXRALNNA.js → chunk-UK7HQ4IL.js} +1 -1
- package/dist/{chunk-NDX4VJO7.js → chunk-VXKKTUU2.js} +2 -2
- package/dist/{chunk-E5CJI7L3.js → chunk-WRYXVIJP.js} +1 -1
- package/dist/{compat-check-WRPEFB5N.js → compat-check-7VBBE7KO.js} +1 -1
- package/dist/{config-IS33K45R.js → config-LFRZBPH5.js} +3 -3
- package/dist/{context-Y2A6QIS3.js → context-WJQGJD6F.js} +1 -1
- package/dist/{data-integration-EIF5QHYF.js → data-integration-KMJWYAKK.js} +2 -1
- package/dist/index.js +34 -32
- package/dist/{memory-6QMZS4HF.js → memory-VPOPSU52.js} +3 -3
- package/dist/{metadata-TMAXVLOL.js → metadata-AR64J76Z.js} +5 -5
- package/dist/{model-LEYRQKOS.js → model-2F2354QP.js} +1 -1
- package/dist/{personal-semantic-preference-RMZEDRCJ.js → personal-semantic-preference-BCOSI4DO.js} +4 -4
- package/dist/{project-semantic-UD3OAZ6K.js → project-semantic-DJLXAXLD.js} +4 -4
- package/dist/{sync-GVF3OI2U.js → sync-4TUIQ2PZ.js} +3 -3
- package/dist/{te-agent-S7UH657Z.js → te-agent-EMDWA3M6.js} +4 -4
- package/dist/{te-analysis-SJIE5OZY.js → te-analysis-XHAMRMTQ.js} +5 -5
- package/dist/{te-community-VNHJDEID.js → te-community-JSUSZEYH.js} +4 -4
- package/dist/{te-dataops-AO4OQBQV.js → te-dataops-I264BUTI.js} +2 -2
- package/dist/{te-engage-EZJRFG3Q.js → te-engage-XNMQYO5N.js} +68 -16
- package/dist/{te-experiment-R2MNSAKV.js → te-experiment-5SCHMYVO.js} +4 -4
- package/dist/{te-kb-C44A4BHM.js → te-kb-QQ53TNRZ.js} +44 -13
- package/dist/{te-system-DB5Z3LLF.js → te-system-Z4VEB6PL.js} +1 -1
- package/dist/{te-team-J52STTEZ.js → te-team-V6BBI52R.js} +87 -6
- package/dist/{things-G2QFXDK7.js → things-THHGDSEC.js} +4 -4
- package/dist/{update-GEKOZMHU.js → update-53ZUXWV5.js} +2 -2
- package/dist/{web-runtime-5M7PRY7R.js → web-runtime-ZJHOIPKX.js} +4 -4
- package/dist/{workspace-RZESYB6T.js → workspace-W5ZPVWJS.js} +3 -3
- package/package.json +3 -3
- package/skills/ae-automation/SKILL.md +6 -2
- package/skills/ae-automation/references/cli.md +9 -3
- package/skills/ae-engage/SKILL.md +6 -1
- package/skills/ae-engage/references/common-metric.md +47 -1
- package/skills/ae-engage/references/flow-metric-update.md +1 -1
- package/skills/ae-engage/references/task-metric-update.md +1 -1
- package/skills/ae-experiment/SKILL.md +1 -1
- package/skills/ae-experiment/references/save_experiment.md +1 -1
- package/skills/ae-kb/SKILL.md +8 -6
- package/skills/ae-kb/references/query-workflow.md +5 -1
- package/skills/ae-team/SKILL.md +7 -3
- package/skills/ae-team/references/copy-to-personal.md +7 -0
- package/skills/ae-team/references/promote.md +7 -0
- package/skills/ae-team/references/update.md +3 -3
- package/skills/ae-tracking-matrix/SKILL.md +0 -170
- 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 +0 -12
- package/skills/ae-tracking-matrix/references/ae-capabilities.md +0 -93
- package/skills/ae-tracking-matrix/references/business-semantic-checks.md +0 -30
- package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +0 -256
- package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +0 -213
- package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +0 -407
- package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +0 -218
- package/skills/ae-tracking-matrix/references/categories/casual_music.md +0 -112
- package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +0 -301
- package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +0 -356
- package/skills/ae-tracking-matrix/references/categories/fishing.md +0 -775
- package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +0 -89
- package/skills/ae-tracking-matrix/references/categories/idle_card.md +0 -27
- package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +0 -415
- package/skills/ae-tracking-matrix/references/categories/interactive_video.md +0 -133
- package/skills/ae-tracking-matrix/references/categories/merge.md +0 -639
- package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +0 -406
- package/skills/ae-tracking-matrix/references/categories/mmo_web.md +0 -230
- package/skills/ae-tracking-matrix/references/categories/music.md +0 -137
- package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +0 -414
- package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +0 -199
- package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +0 -158
- package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +0 -546
- package/skills/ae-tracking-matrix/references/categories/rpg.md +0 -195
- package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +0 -115
- package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +0 -151
- package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +0 -260
- package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +0 -232
- package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +0 -359
- package/skills/ae-tracking-matrix/references/categories/tower_defense.md +0 -365
- package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +0 -211
- package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +0 -132
- package/skills/ae-tracking-matrix/references/category-registry.md +0 -77
- package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +0 -230
- package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +0 -406
- package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +0 -128
- package/skills/ae-tracking-matrix/references/eval-cases.md +0 -74
- package/skills/ae-tracking-matrix/references/naming-dict.md +0 -238
- package/skills/ae-tracking-matrix/references/optimization-checklist.md +0 -85
- package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +0 -142
- package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +0 -47
- package/skills/ae-tracking-matrix/references/plan-generation/reference.md +0 -794
- package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +0 -94
- package/skills/ae-tracking-matrix/references/scene-routing.md +0 -80
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +0 -3787
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +0 -827
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +0 -655
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +0 -953
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +0 -1128
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +0 -714
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +0 -1268
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +0 -776
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +0 -182
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +0 -2755
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +0 -1182
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +0 -1300
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +0 -1369
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +0 -1692
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +0 -902
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +0 -763
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +0 -1107
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +0 -1532
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +0 -845
- package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +0 -228
- package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +0 -149
- package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +0 -407
- package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +0 -163
- package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +0 -149
- package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +0 -153
- package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +0 -232
- package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +0 -314
- package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +0 -117
- package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +0 -148
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +0 -645
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +0 -307
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +0 -347
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +0 -72
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +0 -264
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +0 -566
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +0 -409
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +0 -446
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +0 -557
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +0 -457
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +0 -490
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +0 -523
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +0 -484
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +0 -442
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +0 -391
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +0 -91
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +0 -635
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +0 -113
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +0 -466
- package/skills/ae-tracking-matrix/references/standard-base/README.md +0 -22
- package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +0 -174
- package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +0 -20
- package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +0 -7
- package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +0 -14
- package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +0 -370
- package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +0 -47
- package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +0 -37
- package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +0 -27
- package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +0 -23
- package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +0 -14
- package/skills/ae-tracking-matrix/references/standard-base/user_data.md +0 -46
- package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +0 -13
- package/skills/ae-tracking-matrix/references/system-fields.md +0 -297
- package/skills/ae-tracking-matrix/references/te-field-translations.md +0 -1791
- package/skills/ae-tracking-matrix/references/workflows/data-verification.md +0 -232
- package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +0 -829
- package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +0 -355
- package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +0 -283
- package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +0 -168
- package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +0 -205
- package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +0 -75
- package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +0 -36
- package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +0 -107
- package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +0 -114
- package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +0 -53
- package/skills/ae-tracking-matrix/scripts/finalize_plan.py +0 -166
- package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +0 -674
- package/skills/ae-tracking-matrix/scripts/plan_contract.py +0 -200
- package/skills/ae-tracking-matrix/scripts/plan_types.py +0 -60
- package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +0 -169
- package/skills/ae-tracking-matrix/scripts/sync_plan.py +0 -296
- package/skills/ae-tracking-matrix/scripts/upload_plan.py +0 -340
|
@@ -1,845 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
code: unreal_sdk_installation
|
|
3
|
-
name: "Unreal"
|
|
4
|
-
wikiToken: WzIhwbKmkiwbUDkYZ4hcySdrnrg
|
|
5
|
-
parentWikiToken: BAU2w0eipiqGnckeUsIc0mYQnZc
|
|
6
|
-
updateTime: 1760166643000
|
|
7
|
-
sourceUrl: https://docs-v2.thinkingdata.cn/?version=6.0&lan=zh-CN&code=unreal_sdk_installation
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Unreal
|
|
11
|
-
|
|
12
|
-
::: tip Tip
|
|
13
|
-
|
|
14
|
-
Before integration, please read the Pre-Integration Guide first.
|
|
15
|
-
|
|
16
|
-
TDAnalytics implements Unreal Engine's built-in Analytics service and also supports direct data reporting via C++ code. Currently supports Android, iOS, Windows and macOS platforms. Supports Unreal Engine 4.26+ and 5.+ versions.
|
|
17
|
-
|
|
18
|
-
:::
|
|
19
|
-
|
|
20
|
-
**Latest Version:** v3.0.3
|
|
21
|
-
|
|
22
|
-
**Update Time:** 2025-10-11
|
|
23
|
-
|
|
24
|
-
**Resource Download:** Source code, SDK download
|
|
25
|
-
|
|
26
|
-
::: warning Note
|
|
27
|
-
|
|
28
|
-
This document applies to v2.0.0 and later versions. For historical versions, please refer to Unreal Integration Guide (V1), SDK Download (v1.6.0)
|
|
29
|
-
|
|
30
|
-
:::
|
|
31
|
-
|
|
32
|
-
### 1. SDK Integration
|
|
33
|
-
|
|
34
|
-
#### 1.1 Integrate TDAnalytics Plugin
|
|
35
|
-
|
|
36
|
-
Download the Unreal SDK, unzip it and place `TDAnalytics` in your project's `Plugins` directory; if the `Plugins` directory does not exist, first create a `Plugins` directory in the project root directory, then place the `TDAnalytics` directory inside it.
|
|
37
|
-
|
|
38
|
-
#### 1.2 Enable TDAnalytics Plugin
|
|
39
|
-
|
|
40
|
-
To enable the TDAnalytics plugin, you need to perform the following steps:
|
|
41
|
-
|
|
42
|
-
- Restart Unreal Editor
|
|
43
|
-
- Open Edit > Plugins, enable `TDAnalytics` under the project `Analytics` category
|
|
44
|
-
- If you use Blueprint, please enable `Analytics Blueprint Library` under the built-in `Analytics` category
|
|
45
|
-
- Restart Unreal Editor again
|
|
46
|
-
- Open Edit > Project Settings, set TDAnalytics parameters under the plugin category:
|
|
47
|
-
- Server Url: Required. Receiver address, must use https type address
|
|
48
|
-
- App ID: Required. Your project's APP ID, can be viewed in TE backend project management page
|
|
49
|
-
- TimeZone: Optional, if you need to align timezone, please fill in a standard TimeZone ID, such as "UTC01:00". No need to fill in if timezone alignment is not needed
|
|
50
|
-
- Enable Encrypt: Whether to enable data encryption, default false, when enabled data will be encrypted before uploading to TE
|
|
51
|
-
- EncryptPublicKey: Optional, if not filled will use default configuration, encryption public key
|
|
52
|
-
- EncryptVersion: Optional, if not filled will use default configuration, key version
|
|
53
|
-
- SymmetricEncryption: Optional, if not filled will use default configuration, symmetric key
|
|
54
|
-
- AsymmetricEncryption: Optional, if not filled will use default configuration, asymmetric key
|
|
55
|
-
|
|
56
|
-
Note: Windows/MacOS does not support timezone alignment temporarily.
|
|
57
|
-
|
|
58
|
-
- Add the following content in `DefaultEngine.ini` file under `Config` directory:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
[Analytics]
|
|
62
|
-
ProviderModuleName=TDAnalytics
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
- If you want to use `TDAnalytics` interface directly in C++ code, you need to add the following content in your project's `*.Build.cs` file:
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
PrivateDependencyModuleNames.AddRange(new string[] { "TDAnalytics" });
|
|
69
|
-
PrivateIncludePathModuleNames.AddRange(new string[] { "TDAnalytics" });
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
And, in the file where you want to use SDK, include the `TDAnalytics.h` header file:
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
#include "TDAnalytics.h"
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### 2. Initialization
|
|
79
|
-
|
|
80
|
-
Here is the SDK initialization example code:
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
// Initialize SDK
|
|
84
|
-
UTDAnalytics::Initialize();
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
After initialization is complete, you can use SDK to report events.
|
|
88
|
-
|
|
89
|
-
### 3. Common Features
|
|
90
|
-
|
|
91
|
-
Before using common features, we recommend you understand user identification rules first; SDK will generate a random number as visitor ID by default, and persist visitor ID locally; before user logs in, visitor ID will be used as identity identification ID. Note: Visitor ID will change when user reinstalls App or changes device.
|
|
92
|
-
|
|
93
|
-
#### 3.1 Set Account ID
|
|
94
|
-
|
|
95
|
-
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. Calling `Login` multiple times will overwrite the previous account ID.
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
// User's unique login identifier, this data corresponds to #account_id in reported data, at this time #account_id value is TA
|
|
99
|
-
UTDAnalytics::Login("TA");
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
`Login` can be called multiple times, each call will check whether the passed account ID is consistent with the previously saved ID, if consistent the call will be ignored, if inconsistent it will overwrite the previous ID.
|
|
103
|
-
|
|
104
|
-
**This method will not upload login event**
|
|
105
|
-
|
|
106
|
-
#### 3.2 Set Public Event Properties
|
|
107
|
-
|
|
108
|
-
Public event properties are properties that every event will have, you can call `SetSuperProperties` to set public event properties, we recommend you set public 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, you can set these properties as public event properties.
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
112
|
-
Properties->SetStringField("channel", "ta");//String
|
|
113
|
-
Properties->SetNumberField("age", 1);//Number
|
|
114
|
-
Properties->SetBoolField("isSuccess", true);//Boolean
|
|
115
|
-
FDateTime DateTime = FDateTime::Now();
|
|
116
|
-
Properties->SetStringField("birthday", FDateTime::FromUnixTimestamp(DateTime.ToUnixTimestamp()).ToString(TEXT("%Y-%m-%d %H:%M:%S.")) += *FString::Printf(TEXT("%03d"), DateTime.GetMillisecond()));//Time
|
|
117
|
-
|
|
118
|
-
TSharedPtr<FJsonObject> ItemProperties = MakeShareable(new FJsonObject);
|
|
119
|
-
ItemProperties->SetStringField("itemChannel", "item");
|
|
120
|
-
Properties->SetObjectField("object", ItemProperties);//Object
|
|
121
|
-
|
|
122
|
-
TArray< TSharedPtr<FJsonValue> > DataObjectArray;
|
|
123
|
-
TSharedPtr<FJsonObject> ArrayItemProperties = MakeShareable(new FJsonObject);
|
|
124
|
-
ArrayItemProperties->SetStringField("arrayItemChannel", "array_item");
|
|
125
|
-
TSharedPtr<FJsonValueObject> DataObjectValue = MakeShareable(new FJsonValueObject(ArrayItemProperties));
|
|
126
|
-
DataObjectArray.Add(DataObjectValue);
|
|
127
|
-
Properties->SetArrayField("object_arr", DataObjectArray);//Object array
|
|
128
|
-
|
|
129
|
-
TArray< TSharedPtr<FJsonValue> > DataArray;
|
|
130
|
-
TSharedPtr<FJsonValueString> DataValue = MakeShareable(new FJsonValueString("data_value"));
|
|
131
|
-
DataArray.Add(DataValue);
|
|
132
|
-
Properties->SetArrayField("arr", DataArray);//Array
|
|
133
|
-
|
|
134
|
-
UTDAnalytics::SetSuperProperties(Properties, AppID);
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
- Key is the property name, string type, must start with letter, contain numbers, letters and underscore "\_", maximum length 50 characters, case insensitive, TE will convert to lowercase uniformly
|
|
138
|
-
- Value is the property value, supports string, number, boolean, time, object, object array, array
|
|
139
|
-
|
|
140
|
-
**Event properties and user property requirements are consistent with public event properties**
|
|
141
|
-
|
|
142
|
-
#### 3.3 Enable Auto-tracking
|
|
143
|
-
|
|
144
|
-
The following code example enables install, start, and end events (PC platform does not support auto-tracking), if you want to understand SDK's auto-tracking capabilities in detail, you can view Auto-tracking Feature Detailed Introduction
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
// Enable auto-tracking
|
|
148
|
-
UTDAnalytics::EnableAutoTrack();
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
#### 3.4 Send Event
|
|
152
|
-
|
|
153
|
-
You can call `Track` to upload events, we recommend you set event properties and conditions for sending information according to the previously prepared tracking document, here we use user purchasing a product as an example:
|
|
154
|
-
|
|
155
|
-
```
|
|
156
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
157
|
-
Properties->SetStringField("product_name", "Product Name");//String
|
|
158
|
-
// Report an event without properties
|
|
159
|
-
UTDAnalytics::Track("product_buy", Properties);
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Event name is string type, must start with letter, can contain numbers, letters and underscore "\_", maximum length 50 characters.
|
|
163
|
-
|
|
164
|
-
#### 3.5 Set User Properties
|
|
165
|
-
|
|
166
|
-
For general user properties, you can call `UserSet` to set them, properties uploaded using this interface will overwrite existing property values, if the user property did not exist before, it will create a new user property with the same type as the passed property type, here we use setting username as an example.
|
|
167
|
-
|
|
168
|
-
```
|
|
169
|
-
//At this time "username" is "TA"
|
|
170
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
171
|
-
Properties->SetStringField("username", "TA");//String
|
|
172
|
-
UTDAnalytics::UserSet(Properties);
|
|
173
|
-
//At this time "userName" is "TE"
|
|
174
|
-
TSharedPtr<FJsonObject> NewProperties = MakeShareable(new FJsonObject);
|
|
175
|
-
NewProperties->SetStringField("username", "TE");//String
|
|
176
|
-
UTDAnalytics::UserSet(NewProperties);
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### 4. Best Practices
|
|
180
|
-
|
|
181
|
-
The following example code includes all the above operations, we recommend using the following steps:
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
#include "TDAnalytics.h"
|
|
185
|
-
if (Privacy Policy Authorized) {
|
|
186
|
-
//Initialize SDK
|
|
187
|
-
UTDAnalytics::Initialize();
|
|
188
|
-
// Enable auto-tracking events
|
|
189
|
-
UTDAnalytics::EnableAutoTrack();
|
|
190
|
-
//If user has logged in, can set user's account ID as unique identity identifier
|
|
191
|
-
UTDAnalytics::Login("TA");
|
|
192
|
-
//Set public event properties
|
|
193
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
194
|
-
Properties->SetStringField("channel", "ta");//String
|
|
195
|
-
Properties->SetNumberField("age", 1);//Number
|
|
196
|
-
Properties->SetBoolField("isSuccess", true);//Boolean
|
|
197
|
-
FDateTime DateTime = FDateTime::Now();
|
|
198
|
-
Properties->SetStringField("birthday", FDateTime::FromUnixTimestamp(DateTime.ToUnixTimestamp()).ToString(TEXT("%Y-%m-%d %H:%M:%S.")) += *FString::Printf(TEXT("%03d"), DateTime.GetMillisecond()));//Time
|
|
199
|
-
|
|
200
|
-
TSharedPtr<FJsonObject> ItemProperties = MakeShareable(new FJsonObject);
|
|
201
|
-
ItemProperties->SetStringField("itemChannel", "item");
|
|
202
|
-
Properties->SetObjectField("object", ItemProperties);//Object
|
|
203
|
-
|
|
204
|
-
TArray< TSharedPtr<FJsonValue> > DataObjectArray;
|
|
205
|
-
TSharedPtr<FJsonObject> ArrayItemProperties = MakeShareable(new FJsonObject);
|
|
206
|
-
ArrayItemProperties->SetStringField("arrayItemChannel", "array_item");
|
|
207
|
-
TSharedPtr<FJsonValueObject> DataObjectValue = MakeShareable(new FJsonValueObject(ArrayItemProperties));
|
|
208
|
-
DataObjectArray.Add(DataObjectValue);
|
|
209
|
-
Properties->SetArrayField("object_arr", DataObjectArray);//Object array
|
|
210
|
-
|
|
211
|
-
TArray< TSharedPtr<FJsonValue> > DataArray;
|
|
212
|
-
TSharedPtr<FJsonValueString> DataValue = MakeShareable(new FJsonValueString("data_value"));
|
|
213
|
-
DataArray.Add(DataValue);
|
|
214
|
-
Properties->SetArrayField("arr", DataArray);//Array
|
|
215
|
-
UTDAnalytics::SetSuperProperties(Properties, AppID);
|
|
216
|
-
//Send event
|
|
217
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
218
|
-
Properties->SetStringField("product_name", "Product Name");//String
|
|
219
|
-
UTDAnalytics::Track("product_buy", Properties);
|
|
220
|
-
//Set user properties
|
|
221
|
-
TSharedPtr<FJsonObject> UserProperties = MakeShareable(new FJsonObject);
|
|
222
|
-
UserProperties->SetStringField("username", "TA");//String
|
|
223
|
-
UTDAnalytics::UserSet(Proper);
|
|
224
|
-
}
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
# Advanced Guide
|
|
230
|
-
|
|
231
|
-
### 1. Set User ID
|
|
232
|
-
|
|
233
|
-
SDK instance will use random UUID as default visitor ID for each user by default, this ID will be used as identity identification ID for user in unlogged state. Note that visitor ID will change when user reinstalls App or changes device.
|
|
234
|
-
|
|
235
|
-
#### 1.1 Set Visitor ID
|
|
236
|
-
|
|
237
|
-
::: tip Tip
|
|
238
|
-
|
|
239
|
-
Generally, you don't need to customize visitor ID. Please make sure you understand user identification rules before setting visitor ID.
|
|
240
|
-
|
|
241
|
-
If you need to replace visitor ID, you should call it immediately after SDK initialization ends, do not call multiple times to avoid creating useless accounts.
|
|
242
|
-
|
|
243
|
-
:::
|
|
244
|
-
|
|
245
|
-
If your game has its own visitor ID management system, you can call `SetDistinctId` to set visitor ID:
|
|
246
|
-
|
|
247
|
-
```
|
|
248
|
-
// Set visitor ID to Thinker
|
|
249
|
-
UTDAnalytics::SetDistinctId("Thinker");
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
If you need to get visitor ID, you can call `GetDistinctId` to get:
|
|
253
|
-
|
|
254
|
-
```
|
|
255
|
-
FString distinctId = UTDAnalytics::GetDistinctId();
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
#### 1.2 Set Account ID
|
|
259
|
-
|
|
260
|
-
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. Calling `Login` multiple times will overwrite the previous account ID.
|
|
261
|
-
|
|
262
|
-
```
|
|
263
|
-
// User's unique login identifier, this data corresponds to #account_id in reported data, at this time #account_id value is TA
|
|
264
|
-
UTDAnalytics::Login("TA");
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
**This method will not upload login event**
|
|
268
|
-
|
|
269
|
-
#### 1.3 Clear Account ID
|
|
270
|
-
|
|
271
|
-
After user logs out, you can call `Logout` to clear account ID, before calling `Login` next time, visitor ID will be used as identity identification ID.
|
|
272
|
-
|
|
273
|
-
```
|
|
274
|
-
UTDAnalytics::Logout();
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
We recommend you call `Logout` when there is an explicit logout event, such as when user performs account cancellation action, rather than calling it when closing the game.
|
|
278
|
-
|
|
279
|
-
**This method will not upload logout event**
|
|
280
|
-
|
|
281
|
-
### 2. Send Event
|
|
282
|
-
|
|
283
|
-
After SDK initialization is complete, you can perform data tracking and collect user behavior information. Generally, normal events can meet business scenario requirements, you can also use first, updatable and other events according to your actual business scenarios.
|
|
284
|
-
|
|
285
|
-
#### 2.1 Normal Event
|
|
286
|
-
|
|
287
|
-
You can call `track` to upload events, we recommend you set event properties and conditions for sending events according to the previously prepared document, here we use user purchasing a product as an example:
|
|
288
|
-
|
|
289
|
-
```
|
|
290
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
291
|
-
Properties->SetStringField("product_name", "Product Name");
|
|
292
|
-
UTDAnalytics::Track("product_buy",Properties);
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
#### 2.2 First Event
|
|
296
|
-
|
|
297
|
-
First event refers 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 the first event that occurs on a certain device, then you can use first event to report data.
|
|
298
|
-
|
|
299
|
-
```
|
|
300
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
301
|
-
Properties->SetStringField("key", "value");
|
|
302
|
-
UTDAnalytics::TrackFirst("device_activation",Properties);
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
If you want to determine whether it's the first time based on dimensions other than device, you can customize first_check_id for first event:
|
|
306
|
-
|
|
307
|
-
```
|
|
308
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
309
|
-
Properties->SetStringField("key", "value");
|
|
310
|
-
UTDAnalytics::TrackFirstWithId("account_activation", Properties,"TA");
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
Note: Since the verification of whether it's the first time is completed on the server side, first event will be delayed by 1 hour before entering the database by default.
|
|
314
|
-
|
|
315
|
-
#### 2.3 Updatable Event
|
|
316
|
-
|
|
317
|
-
You can use updatable event to achieve the requirement of modifying event data in specific scenarios. Updatable event needs to specify the ID that identifies the event and pass it when creating the updatable event object. TE backend will determine the data that needs to be updated based on event name and event ID.
|
|
318
|
-
|
|
319
|
-
```
|
|
320
|
-
// Example: Report an updatable event, assume event name is UPDATABLE_EVENT
|
|
321
|
-
// After reporting, event property status is 3, price is 100
|
|
322
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
323
|
-
Properties->SetNumberField("status",3);
|
|
324
|
-
Properties->SetNumberField("price",100);
|
|
325
|
-
UTDAnalytics::TrackUpdate("UPDATABLE_EVENT", Properties,"test_event_id");
|
|
326
|
-
|
|
327
|
-
// After reporting, event property status is 5, price is 100
|
|
328
|
-
TSharedPtr<FJsonObject> NewProperties = MakeShareable(new FJsonObject);
|
|
329
|
-
NewProperties->SetNumberField("status",5);
|
|
330
|
-
UTDAnalytics::TrackUpdate("UPDATABLE_EVENT",NewProperties,"test_event_id");
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
#### 2.4 Overwritable Event
|
|
334
|
-
|
|
335
|
-
Overwritable event is similar to updatable event, the difference is that overwritable event will completely overwrite historical data with the latest data, from the effect it's equivalent to deleting the previous data and storing the latest data in the database. TE backend will determine the data that needs to be updated based on event name and event ID.
|
|
336
|
-
|
|
337
|
-
```
|
|
338
|
-
// Example: Report an overwritable event, assume event name is UPDATABLE_EVENT
|
|
339
|
-
// After reporting, event property status is 3, price is 100
|
|
340
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
341
|
-
Properties->SetNumberField("status",3);
|
|
342
|
-
Properties->SetNumberField("price",100);
|
|
343
|
-
UTDAnalytics::TrackOverwrite("OVERWRITE_EVENT", Properties,"test_event_id");
|
|
344
|
-
|
|
345
|
-
// After reporting, event property status is 5, price property is deleted
|
|
346
|
-
TSharedPtr<FJsonObject> NewProperties = MakeShareable(new FJsonObject);
|
|
347
|
-
NewProperties->SetNumberField("status",5);
|
|
348
|
-
UTDAnalytics::TrackOverwrite("OVERWRITE_EVENT",NewProperties,"test_event_id")
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
#### 2.5 Public Event Properties
|
|
352
|
-
|
|
353
|
-
Public event properties are properties that every event will upload. Based on 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 specific business scenario requirements; we recommend you set public event properties before sending events. For the same event, when public event property, event custom property, and preset property have the same Key, we will assign values according to the following priority: `Custom Property > Dynamic Public Event Property > Static Public Event Property > Preset Property`.
|
|
354
|
-
|
|
355
|
-
##### 2.5.1 Static Public Event Properties
|
|
356
|
-
|
|
357
|
-
Static public event properties are low-frequency changing properties that every event will have, such as user membership level. After setting static public event properties through `SetSuperProperties`, SDK will get the set public event properties as event properties when collecting events.
|
|
358
|
-
|
|
359
|
-
```
|
|
360
|
-
TSharedPtr<FJsonObject> SuperProperties = MakeShareable(new FJsonObject);
|
|
361
|
-
SuperProperties->SetNumberField("vip_level",2);
|
|
362
|
-
UTDAnalytics::SetSuperProperties(SuperProperties);
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
Static public event properties will be saved to cache, no need to call every time when starting App. 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 public event properties to meet daily business needs.
|
|
366
|
-
|
|
367
|
-
```
|
|
368
|
-
//Get all public event properties
|
|
369
|
-
TSharedPtr<FJsonObject> SuperProperties = UTDAnalytics::GetSuperProperties();
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
##### 2.5.2 Set Dynamic Public Properties
|
|
373
|
-
|
|
374
|
-
Dynamic public event properties are high-frequency changing properties that every event will have, such as user's gold coin count. After setting dynamic public property class through `SetDynamicSuperPropertiesTracker`, SDK will automatically get dynamic public event properties when collecting events and add them to triggered events.
|
|
375
|
-
|
|
376
|
-
```
|
|
377
|
-
// Define dynamic public property function
|
|
378
|
-
static FString TDReturnDyldParams() {
|
|
379
|
-
return "{\"dyld_property1\":\"value1\",\"dyld_property2\":\"value2\"}";
|
|
380
|
-
}
|
|
381
|
-
// Set dynamic public properties
|
|
382
|
-
void UMyDemoWidget::callSetDynamicSuperPropertiesFunction(){
|
|
383
|
-
// Before V1.5.0
|
|
384
|
-
UTDAnalytics::dynamicPropertiesMap.insert(pair<FString,FString(*)(void)>("insert your appid" ,&TDReturnDyldParams));
|
|
385
|
-
// From V1.5.0
|
|
386
|
-
UTDAnalytics::SetDynamicSuperProperties(this, &UMyDemoWidget::TDReturnDyldParams, "your appid");
|
|
387
|
-
}
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
#### 2.6 Record Event Duration
|
|
391
|
-
|
|
392
|
-
If you need to record the duration of an event, you can call `timeEvent` to configure the event name you want to time and start timing, when you upload that event, it will automatically add `#duration` property in your event properties to represent the recorded duration, unit is seconds. Note that the same event name can only have one timing task.
|
|
393
|
-
|
|
394
|
-
```
|
|
395
|
-
//The following example completes the statistics of user's stay duration on a product page
|
|
396
|
-
//User enters product page, start timing
|
|
397
|
-
UTDAnalytics::TimeEvent("stay_shop");
|
|
398
|
-
/**do something
|
|
399
|
-
.......
|
|
400
|
-
**/
|
|
401
|
-
//User leaves product page, timing ends, "stay_shop" event will have #duration property representing event duration
|
|
402
|
-
UTDAnalytics::Track("stay_shop", "");
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
Note: Windows/MacOS does not support recording event duration temporarily.
|
|
406
|
-
|
|
407
|
-
### 3. User Properties
|
|
408
|
-
|
|
409
|
-
TE platform supported user property setting APIs are: `UserSet`, `UserSetOnce`, `UserAdd`, `UserDelete`, `UserUnset`, `UserAppend`, `UserUniqueAppend`.
|
|
410
|
-
|
|
411
|
-
#### 3.1 UserSet
|
|
412
|
-
|
|
413
|
-
For general user properties, you can call `UserSet` to set them. Properties uploaded using this interface will overwrite existing property values, if the user property did not exist before, it will create a new user property with the same type as the passed property type, here we use setting username as an example:
|
|
414
|
-
|
|
415
|
-
```
|
|
416
|
-
//At this time username is TA
|
|
417
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
418
|
-
Properties->SetStringField("user_name", "TA");
|
|
419
|
-
UTDAnalytics::UserSet(Properties);
|
|
420
|
-
//At this time username is TE
|
|
421
|
-
TSharedPtr<FJsonObject> NewProperties = MakeShareable(new FJsonObject);
|
|
422
|
-
NewProperties->SetStringField("user_name", "TE");
|
|
423
|
-
UTDAnalytics::UserSet(NewProperties);
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
#### 3.2 UserSetOnce
|
|
427
|
-
|
|
428
|
-
If the user property you want to upload only needs to be set once, you can call `UserSetOnce` to set it, when the property already has a value before, this message will be ignored, here we use setting first payment time as an example:
|
|
429
|
-
|
|
430
|
-
```
|
|
431
|
-
//first_payment_time is 2018-01-01 01:23:45.678
|
|
432
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
433
|
-
Properties->SetStringField("first_payment_time","2018-01-01 01:23:45.678");
|
|
434
|
-
UTDAnalytics::UserSetOnce(Properties);
|
|
435
|
-
//first_payment_time is still 2018-01-01 01:23:45.678
|
|
436
|
-
TSharedPtr<FJsonObject> NewProperties = MakeShareable(new FJsonObject);
|
|
437
|
-
NewProperties->SetStringField("first_payment_time","2018-12-31 01:23:45.678");
|
|
438
|
-
UTDAnalytics::UserSetOnce(NewProperties);
|
|
439
|
-
```
|
|
440
|
-
|
|
441
|
-
#### 3.3 UserAdd
|
|
442
|
-
|
|
443
|
-
When you want to upload numeric properties, you can call `UserAdd` to accumulate the property, if the property hasn't been set yet, it will assign 0 before calculation, can pass negative value, equivalent to subtraction operation. Here we use cumulative payment amount as an example:
|
|
444
|
-
|
|
445
|
-
```
|
|
446
|
-
//At this time total_revenue is 30
|
|
447
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
448
|
-
Properties->SetNumberField("total_revenue",30);
|
|
449
|
-
UTDAnalytics::UserAdd(Properties);
|
|
450
|
-
//At this time total_revenue is 678
|
|
451
|
-
TSharedPtr<FJsonObject> NewProperties = MakeShareable(new FJsonObject);
|
|
452
|
-
NewProperties->SetNumberField("total_revenue",648);
|
|
453
|
-
UTDAnalytics::UserAdd(NewProperties);
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
The property key is string, Value only allows numeric values.
|
|
457
|
-
|
|
458
|
-
#### 3.4 UserDelete
|
|
459
|
-
|
|
460
|
-
If you want to delete a user, you can call `UserDelete` to delete this 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.
|
|
461
|
-
|
|
462
|
-
```
|
|
463
|
-
UTDAnalytics::UserDelete();
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
#### 3.5 UserUnset
|
|
467
|
-
|
|
468
|
-
If you need to reset a user's property, you can call `UserUnset` to delete the already set property.
|
|
469
|
-
|
|
470
|
-
```
|
|
471
|
-
UTDAnalytics::UserUnset("userPropertyName");
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
The input value of UserUnset is the Key value of the property being cleared.
|
|
475
|
-
|
|
476
|
-
#### 3.6 UserAppend
|
|
477
|
-
|
|
478
|
-
You can call UserAppend to append elements to List type user properties.
|
|
479
|
-
|
|
480
|
-
```
|
|
481
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
482
|
-
TArray< TSharedPtr<FJsonValue> > DataArray;
|
|
483
|
-
DataArray.Add(MakeShareable(new FJsonValueString("apple")));
|
|
484
|
-
DataArray.Add(MakeShareable(new FJsonValueString("ball")));
|
|
485
|
-
Properties->SetArrayField("user_list", DataArray);//Array
|
|
486
|
-
UTDAnalytics::UserAppend(Properties);
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
#### 3.7 UserUniqueAppend
|
|
490
|
-
|
|
491
|
-
You can call `UserUniqueAppend` to append elements to array type user properties. Calling `UserUniqueAppend` interface will deduplicate the appended user properties, `UserAppend` interface does not deduplicate, user properties can have duplicates.
|
|
492
|
-
|
|
493
|
-
```
|
|
494
|
-
//At this time user_list property value is ["apple", "ball"]
|
|
495
|
-
TSharedPtr<FJsonObject> Properties = MakeShareable(new FJsonObject);
|
|
496
|
-
TArray< TSharedPtr<FJsonValue> > DataArray;
|
|
497
|
-
DataArray.Add(MakeShareable(new FJsonValueString("apple")));
|
|
498
|
-
DataArray.Add(MakeShareable(new FJsonValueString("ball")));
|
|
499
|
-
Properties->SetArrayField("user_list", DataArray);//Array
|
|
500
|
-
UTDAnalytics::UserAppend(Properties);
|
|
501
|
-
|
|
502
|
-
//At this time user_list property value is ["apple", "apple", "ball", "cube"]
|
|
503
|
-
TSharedPtr<FJsonObject> Properties1 = MakeShareable(new FJsonObject);
|
|
504
|
-
TArray< TSharedPtr<FJsonValue> > DataArray1;
|
|
505
|
-
DataArray1.Add(MakeShareable(new FJsonValueString("apple")));
|
|
506
|
-
DataArray1.Add(MakeShareable(new FJsonValueString("cube")));
|
|
507
|
-
Properties->SetArrayField("user_list", DataArray1);//Array
|
|
508
|
-
UTDAnalytics::UserAppend(Properties1);
|
|
509
|
-
|
|
510
|
-
//At this time user_list property value is ["apple", "ball", "cube"]
|
|
511
|
-
UTDAnalytics::UserUniqueAppend(Properties1);
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
### 4. Other Features
|
|
515
|
-
|
|
516
|
-
#### 4.1 Get Device ID
|
|
517
|
-
|
|
518
|
-
You can get device ID by calling `GetDeviceId`:
|
|
519
|
-
|
|
520
|
-
```
|
|
521
|
-
FString deviceId = UTDAnalytics::GetDeviceId();
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
#### 4.2 Calibrate Time
|
|
525
|
-
|
|
526
|
-
SDK will use local time as event occurrence time by default, if user manually modifies device time it will affect your business analysis, you can ensure the accuracy of event occurrence time through time calibration operation. We provide `timestamp` and `NTP` two time calibration methods.
|
|
527
|
-
|
|
528
|
-
- 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 calibrated time as occurrence time.
|
|
529
|
-
|
|
530
|
-
```
|
|
531
|
-
// 1585633785954 is current unix timestamp, unit is milliseconds, corresponding to Beijing time 2020-03-31 13:49:45
|
|
532
|
-
UTDAnalytics::CalibrateTime(1585633785954);
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
- You can also set NTP server address, after that SDK will try to get current time from passed NTP service address and calibrate SDK time. If correct return result is not obtained within default timeout (3 seconds), subsequent data will be reported using local time.
|
|
536
|
-
|
|
537
|
-
```
|
|
538
|
-
// Use Apple's NTP service to calibrate time
|
|
539
|
-
UTDAnalytics::CalibrateTimeWithNtp("time.apple.com");
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
1. Using NTP service for time calibration has certain uncertainty, we recommend you prioritize timestamp calibration method
|
|
543
|
-
|
|
544
|
-
2. You need to carefully choose your NTP server address to ensure user device can quickly get server time under good network conditions
|
|
545
|
-
|
|
546
|
-
#### 4.3 Flush Data Immediately
|
|
547
|
-
|
|
548
|
-
In some business scenarios, if you expect data to be reported to TE server immediately, you can call `Flush` interface to complete
|
|
549
|
-
|
|
550
|
-
```
|
|
551
|
-
UTDAnalytics::Flush();
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
---
|
|
555
|
-
|
|
556
|
-
# Third-party Data
|
|
557
|
-
|
|
558
|
-
From v1.5.0, third-party data integration feature is supported. Here is the example code for synchronizing data from multiple platforms:
|
|
559
|
-
|
|
560
|
-
```
|
|
561
|
-
TArray<FString> EventTypeList;
|
|
562
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
|
|
563
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeIRONSOURCE"));
|
|
564
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeADJUST"));
|
|
565
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeBRANCH"));
|
|
566
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTOPON"));
|
|
567
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRACKING"));
|
|
568
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRADPLUS"));
|
|
569
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
570
|
-
```
|
|
571
|
-
|
|
572
|
-
If you need to add custom parameters, you can use EnableThirdPartySharingWithCustomProperties:
|
|
573
|
-
|
|
574
|
-
```
|
|
575
|
-
TArray<FString> EventTypeList;
|
|
576
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
|
|
577
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeIRONSOURCE"));
|
|
578
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeADJUST"));
|
|
579
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeBRANCH"));
|
|
580
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTOPON"));
|
|
581
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRACKING"));
|
|
582
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRADPLUS"));
|
|
583
|
-
|
|
584
|
-
TSharedPtr<FJsonObject> m_DataJsonObject = MakeShareable(new FJsonObject);
|
|
585
|
-
m_DataJsonObject->SetStringField(TEXT("thirdkey1"), TEXT("thirdvalue1"));
|
|
586
|
-
m_DataJsonObject->SetStringField(TEXT("thirdkey2"), TEXT("thirdvalue2"));
|
|
587
|
-
UTDAnalytics::EnableThirdPartySharingWithCustomProperties(EventTypeList, m_DataJsonObject, AppID);
|
|
588
|
-
```
|
|
589
|
-
|
|
590
|
-
### 1. AppsFlyer
|
|
591
|
-
|
|
592
|
-
Call API before AppsFlyer SDK calls start method.
|
|
593
|
-
|
|
594
|
-
```
|
|
595
|
-
TArray<FString> EventTypeList;
|
|
596
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
|
|
597
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
After creating character (optional).
|
|
601
|
-
|
|
602
|
-
```
|
|
603
|
-
UTDAnalytics::Login("account_id", AppID);
|
|
604
|
-
TArray<FString> EventTypeList;
|
|
605
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
|
|
606
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
If TE's Login method (will modify account_id) or Identify method (will modify distinct_id) is called, you need to call EnableThirdPartySharing again to synchronize data.
|
|
610
|
-
|
|
611
|
-
Note: If you also need to call AppsFlyer SDK's setAdditionalData method, you can pass parameters to TE through EnableThirdPartySharingWithCustomProperties, TE SDK will internally concatenate and merge the parameters.
|
|
612
|
-
|
|
613
|
-
```
|
|
614
|
-
TArray<FString> EventTypeList;
|
|
615
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeAPPSFLYER"));
|
|
616
|
-
TSharedPtr<FJsonObject> m_DataJsonObject = MakeShareable(new FJsonObject);
|
|
617
|
-
m_DataJsonObject->SetStringField(TEXT("thirdkey1"), TEXT("thirdvalue1"));
|
|
618
|
-
m_DataJsonObject->SetStringField(TEXT("thirdkey2"), TEXT("thirdvalue2"));
|
|
619
|
-
UTDAnalytics::EnableThirdPartySharingWithCustomProperties(EventTypeList, m_DataJsonObject, AppID);
|
|
620
|
-
```
|
|
621
|
-
|
|
622
|
-
### 2. Adjust
|
|
623
|
-
|
|
624
|
-
Call before Adjust SDK initialization.
|
|
625
|
-
|
|
626
|
-
```
|
|
627
|
-
TArray<FString> EventTypeList;
|
|
628
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeADJUST"));
|
|
629
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
630
|
-
```
|
|
631
|
-
|
|
632
|
-
After creating character (optional).
|
|
633
|
-
|
|
634
|
-
```
|
|
635
|
-
UTDAnalytics::Login("account_id", AppID);
|
|
636
|
-
TArray<FString> EventTypeList;
|
|
637
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeADJUST"));
|
|
638
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
### 3. Branch
|
|
642
|
-
|
|
643
|
-
Call before Branch initialize the session.
|
|
644
|
-
|
|
645
|
-
```
|
|
646
|
-
TArray<FString> EventTypeList;
|
|
647
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeBRANCH"));
|
|
648
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
649
|
-
```
|
|
650
|
-
|
|
651
|
-
After creating character (optional).
|
|
652
|
-
|
|
653
|
-
```
|
|
654
|
-
UTDAnalytics::Login("account_id", AppID);
|
|
655
|
-
TArray<FString> EventTypeList;
|
|
656
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeBRANCH"));
|
|
657
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
658
|
-
```
|
|
659
|
-
|
|
660
|
-
### 4. TopOn
|
|
661
|
-
|
|
662
|
-
Call before ATSDK.\*init.
|
|
663
|
-
|
|
664
|
-
```
|
|
665
|
-
TArray<FString> EventTypeList;
|
|
666
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTOPON"));
|
|
667
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
668
|
-
```
|
|
669
|
-
|
|
670
|
-
Note: If you also need to call ATSDK's initCustomMap method, you can pass parameters to TE through EnableThirdPartySharingWithCustomProperties, TE SDK will internally concatenate and merge the parameters.
|
|
671
|
-
|
|
672
|
-
```
|
|
673
|
-
TArray<FString> EventTypeList;
|
|
674
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTOPON"));
|
|
675
|
-
TSharedPtr<FJsonObject> m_DataJsonObject = MakeShareable(new FJsonObject);
|
|
676
|
-
m_DataJsonObject->SetStringField(TEXT("thirdkey1"), TEXT("thirdvalue1"));
|
|
677
|
-
m_DataJsonObject->SetStringField(TEXT("thirdkey2"), TEXT("thirdvalue2"));
|
|
678
|
-
UTDAnalytics::EnableThirdPartySharingWithCustomProperties(EventTypeList, m_DataJsonObject, AppID);
|
|
679
|
-
```
|
|
680
|
-
|
|
681
|
-
### 5. TradPlus
|
|
682
|
-
|
|
683
|
-
Call before TradPlusSdk.\*initSdk.
|
|
684
|
-
|
|
685
|
-
```
|
|
686
|
-
TArray<FString> EventTypeList;
|
|
687
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRADPLUS"));
|
|
688
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
### 6. IronSource
|
|
692
|
-
|
|
693
|
-
Call after IronSourceSdk initialization.
|
|
694
|
-
|
|
695
|
-
```
|
|
696
|
-
TArray<FString> EventTypeList;
|
|
697
|
-
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeIRONSOURCE"));
|
|
698
|
-
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
---
|
|
702
|
-
|
|
703
|
-
# Real-time Debugging
|
|
704
|
-
|
|
705
|
-
During SDK integration, you can perform real-time debugging by viewing SDK logs in IDE console or using TE's Debug feature.
|
|
706
|
-
|
|
707
|
-
#### 1. Print SDK Logs
|
|
708
|
-
|
|
709
|
-
Enable Log in TDAnalytics plugin
|
|
710
|
-
|
|
711
|
-
After enabling logs, you can filter TDAnalytics related logs in IDE to observe SDK data reporting.
|
|
712
|
-
|
|
713
|
-
#### 2. Enable Debug Mode
|
|
714
|
-
|
|
715
|
-
Enabling Debug mode requires the following two steps:
|
|
716
|
-
|
|
717
|
-
1. Client enables Debug mode
|
|
718
|
-
Set SDK MODE to Debug in TDAnalytics plugin.
|
|
719
|
-
|
|
720
|
-
- NORMAL mode: Data will be stored in cache and reported according to certain cache strategy, default is NORMAL mode; recommended for production environment
|
|
721
|
-
- Debug mode: Data is reported one by one. When problems occur, it will prompt users with logs and exceptions; not recommended for production environment
|
|
722
|
-
- DebugOnly mode: Only validates data, will not store in database; not recommended for production environment
|
|
723
|
-
|
|
724
|
-
2. TE backend adds Debug device
|
|
725
|
-
To avoid Debug mode going live in production environment, it is specified that only designated devices can enable Debug mode. Only when client has enabled Debug mode and device ID is configured in TE backend's "Tracking Management" page's "Debug Data" section can Debug mode be enabled.
|
|
726
|
-
|
|
727
|
-
Device ID can be obtained through the following three ways:
|
|
728
|
-
|
|
729
|
-
- #device_id property in event data on TE platform
|
|
730
|
-
- Client log: SDK will print device DeviceId after initialization is complete
|
|
731
|
-
- Call through instance interface: Get Device ID
|
|
732
|
-
|
|
733
|
-
Debug mode may affect data collection quality and App stability, only use for integration phase data validation, do not use in production environment.
|
|
734
|
-
|
|
735
|
-
---
|
|
736
|
-
|
|
737
|
-
# Auto-tracking
|
|
738
|
-
|
|
739
|
-
### 1. Auto-tracking Events
|
|
740
|
-
|
|
741
|
-
TDAnalytics SDK currently supports three types of auto-tracking events:
|
|
742
|
-
|
|
743
|
-
- ta_app_install: Game install, this event will be collected when game is first opened after installation
|
|
744
|
-
- ta_app_start: Game enters foreground event
|
|
745
|
-
- ta_app_end: Game exits to background event
|
|
746
|
-
You can enable auto-tracking by calling `EnableAutoTrack` interface:
|
|
747
|
-
|
|
748
|
-
```
|
|
749
|
-
// Enable auto-tracking
|
|
750
|
-
UTDAnalytics::EnableAutoTrack();
|
|
751
|
-
```
|
|
752
|
-
|
|
753
|
-
Note: If you need to customize visitor ID, please call Identify interface to set visitor ID before enabling auto-tracking feature.
|
|
754
|
-
|
|
755
|
-
You can also manually pass in auto-tracking events that need to be enabled:
|
|
756
|
-
|
|
757
|
-
```
|
|
758
|
-
TArray<FString> EventTypeList;
|
|
759
|
-
EventTypeList.Emplace(TEXT("ta_app_install"));
|
|
760
|
-
EventTypeList.Emplace(TEXT("ta_app_start"));
|
|
761
|
-
EventTypeList.Emplace(TEXT("ta_app_end"));
|
|
762
|
-
UTDAnalytics::EnableAutoTrackWithType(EventTypeList, AppID);
|
|
763
|
-
```
|
|
764
|
-
|
|
765
|
-
### 2. Set Custom Properties
|
|
766
|
-
|
|
767
|
-
From v1.4.1, custom properties can be set for auto-tracking events, when collecting specified events, custom properties will be merged into the event properties and reported.
|
|
768
|
-
|
|
769
|
-
```
|
|
770
|
-
TArray<FString> EventTypeList;
|
|
771
|
-
EventTypeList.Emplace(TEXT("ta_app_install"));
|
|
772
|
-
EventTypeList.Emplace(TEXT("ta_app_start"));
|
|
773
|
-
EventTypeList.Emplace(TEXT("ta_app_end"));
|
|
774
|
-
UTDAnalytics::EnableAutoTrackWithTypeAndProperties(EventTypeList, TEXT("{\"autoTrackKey1\":\"autoTrackvalue1\",\"autoTrackKey2\":\"autoTrackvalue2\"}"), AppID);
|
|
775
|
-
```
|
|
776
|
-
|
|
777
|
-
### 3. Set Auto-tracking Event Callback
|
|
778
|
-
|
|
779
|
-
From V1.5.0, callback method can be set for auto-tracking events, when collecting specified events, it will notify through this callback and return the current event properties carried, you can forward data or add new event properties as return according to needs.
|
|
780
|
-
|
|
781
|
-
```
|
|
782
|
-
//Define callback
|
|
783
|
-
FString UTAUserWidget::TAAutoTrackProperties(FString AutoTrackEventType, FString Properties)
|
|
784
|
-
{
|
|
785
|
-
//AutoTrackEventType auto-tracking event type
|
|
786
|
-
//Properties current event properties
|
|
787
|
-
//Processing logic
|
|
788
|
-
FDateTime TDateTime = FDateTime::Now();
|
|
789
|
-
int64 SecondTimestamp = TDateTime.ToUnixTimestamp();
|
|
790
|
-
int32 MillisecondPart = TDateTime.GetMillisecond();
|
|
791
|
-
FString TimeStr = *FString::Printf(TEXT("%llu"), SecondTimestamp);
|
|
792
|
-
TimeStr += *FString::Printf(TEXT("%lld"), MillisecondPart);
|
|
793
|
-
return "{\"auto_property1_name\":\"" + AutoTrackEventType + "\",\"auto_property2_time\":\"" + TimeStr + "\"}";
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
//Set callback
|
|
797
|
-
void UTAUserWidget::Call_TA_SetAutoTrackEventListener()
|
|
798
|
-
{
|
|
799
|
-
TArray<FString> EventTypeList;
|
|
800
|
-
EventTypeList.Emplace(TEXT("ta_app_install"));
|
|
801
|
-
EventTypeList.Emplace(TEXT("ta_app_start"));
|
|
802
|
-
EventTypeList.Emplace(TEXT("ta_app_end"));
|
|
803
|
-
UTDAnalytics::SetAutoTrackEventListener(this, &UTAUserWidget::TAAutoTrackProperties, EventTypeList, AppID);
|
|
804
|
-
}
|
|
805
|
-
```
|
|
806
|
-
|
|
807
|
-
---
|
|
808
|
-
|
|
809
|
-
# Preset Properties
|
|
810
|
-
|
|
811
|
-
#### 1. Preset Property Description
|
|
812
|
-
|
|
813
|
-
Preset properties collected by each platform will have certain differences, you can refer to the following documents: Android Platform, iOS Platform
|
|
814
|
-
|
|
815
|
-
**Non-Native Platform (PC) Preset Properties:**
|
|
816
|
-
|
|
817
|
-
**Property Name** | **Chinese Name** | **Property Type** | **Description**
|
|
818
|
-
#ip | IP Address | Text | User's IP address, TE will use this to get user's geographic location information
|
|
819
|
-
#country | Country | Text | User's country, generated based on IP address
|
|
820
|
-
#country_code | Country Code | Text | User's country code (ISO 3166-1 alpha-2, i.e. two uppercase English letters), generated based on IP address
|
|
821
|
-
#province | Province | Text | User's province, generated based on IP address
|
|
822
|
-
#city | City | Text | User's city, generated based on IP address
|
|
823
|
-
#os_version | Operating System Version | Text | Such as windows10
|
|
824
|
-
#os | Operating System | Text | Such as MacOS, Windows, etc.
|
|
825
|
-
#device_id | Device ID | Text | User's device ID
|
|
826
|
-
#screen_height | Screen Height | Number | User device's screen height, such as 1920
|
|
827
|
-
#screen_width | Screen Width | Number | User device's screen height, such as 1080
|
|
828
|
-
#app_version | APP Version | Text | Your APP's version
|
|
829
|
-
#lib_version | SDK Version | Text | SDK version you integrated
|
|
830
|
-
#zone_offset | Timezone Offset | Number | Data time offset hours relative to UTC time
|
|
831
|
-
#system_language | Operating System Language | Text | Language set in user's system, such as zh
|
|
832
|
-
#install_time | Install Time | Time | User's app installation time
|
|
833
|
-
#fps | Frame Rate | Text | Current screen frame rate
|
|
834
|
-
#disk | Disk Status | Text | Current storage usage "remaining/total space"
|
|
835
|
-
#ram | Memory Status | Text | Current memory usage "remaining/total memory"
|
|
836
|
-
|
|
837
|
-
For versions 3.0.0 and later, the underlying layer uses C++ SDK, #install_time, #app_version, #os_version, #fps, #ram, #disk preset properties cannot be collected temporarily. If you need these preset properties, you can use versions before 3.0.0.
|
|
838
|
-
|
|
839
|
-
#### 2. Get Preset Properties
|
|
840
|
-
|
|
841
|
-
In v1.3.0 version, preset property interface is added, SDK will automatically add some built-in properties when reporting event properties, you can get preset properties through this interface.
|
|
842
|
-
|
|
843
|
-
```
|
|
844
|
-
FString PresetProperties = UTDAnalytics::GetPresetProperties();
|
|
845
|
-
```
|