Mini programs & mini games
Latest version: v1.3.0
Update time: 2026-02-02
Supported platforms: WeChat mini programs, WeChat mini games, Alipay mini programs, Alipay mini games, Douyin mini programs, Douyin mini games, Kuaishou mini programs, Kuaishou mini games
Downloads: Download (mini programs) Download (mini games)
1. Overview
Starting from AE 4.4, the Engage module provides the client-triggered task feature, which supports millisecond-level triggering in in-app scenarios such as new user registration and character creation, as well as real-time A/B splitting. On the client side, the ThinkingData SDK communicates with the AE backend to fetch and evaluate tasks.
Integrate the ThinkingData SDK into your mini game. On the mini game side, you only need to handle interactions with the ThinkingData SDK and don't need to care about task details in the AE backend.
2. Integration
2.1 Integrate the SDK manually
Client-triggered tasks depend on the following ThinkingData SDKs:
| SDK Name | Description | Version requirement |
|---|---|---|
| TDAnalytics | Collects and processes data | >= 3.1.0 |
| TDRemoteconfig | Fetches configuration from the AE backend | >= 1.0.0 |
| TDCore | Provides unified initialization | >= 1.0.0 |
| TDStrategy | Provides client-side triggering | >=1.0.0 |
- Click the download link at the top of this page to download the SDK, and then unzip it
- The mini program & mini game SDK provides a set of standard APIs for common mini program and mini game platforms. The following uses the files for the WeChat platform as an example:
Mini programs
- WeChat mini programs: tdcore.wx.min.js, tdanalytics.wx.min.js, tdremoteconfig.wx.min.js, tdstrategy.wx.min.js
Mini games
- WeChat mini games: tdcore.mg.wx.min.js, tdanalytics.mg.wx.min.js, tdremoteconfig.mg.wx.min.js, tdstrategy.mg.wx.min.js
- Drag the files for the corresponding platform into the same directory of your project
3. Initialization
Initialize the SDK
var TDApp = require("./tdcore.mg.wx.min.js");
var TDAnalytics = require("./tdanalytics.mg.wx.min.js");
var TDRemoteConfig = require("./tdremoteconfig.mg.wx.min.js");
var TDStrategy = require("./tdstrategy.mg.wx.min.js");
TDApp.init({
appId: "AppId",
serverUrl:"ServerUrl",
enableLog:true,
autoTrack: {
appLaunch: true, // Auto-track ta_mg_launch
appShow: true, // Auto-track ta_mg_show
appHide: true // Auto-track ta_mg_hide
},
triggerListener:function(result){
}
});
4. Set a callback listener
When you initialize the SDK, set a callback listener for the TDStrategy SDK.
//Configure in the initialization config
triggerListener:function(result){
}
TDStrategy SDK task trigger result:
| Property name | Type | Description |
|---|---|---|
| channelMsgType | String | Channel message type |
| appId | String | The app id of your AE project |
| pushId | String | Channel send ID of the operation task |
| taskId | String | ID of the operation task |
| content | object | Push content of the operation task |
| userParams | object | Custom parameters in the client channel |
| opsProperties | object | Channel information carried by the client-triggered task, used as receipt parameters for touch funnel events. |

