Skip to main content

Mini programs & mini games

Last updated 10/05/2026

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 NameDescriptionVersion requirement
TDAnalyticsCollects and processes data>= 3.1.0
TDRemoteconfigFetches configuration from the AE backend>= 1.0.0
TDCoreProvides unified initialization>= 1.0.0
TDStrategyProvides client-side triggering>=1.0.0
  1. Click the download link at the top of this page to download the SDK, and then unzip it
  2. 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
  1. 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 nameTypeDescription
channelMsgTypeStringChannel message type
appIdStringThe app id of your AE project
pushIdStringChannel send ID of the operation task
taskIdStringID of the operation task
contentobjectPush content of the operation task
userParamsobjectCustom parameters in the client channel
opsPropertiesobjectChannel information carried by the client-triggered task, used as receipt parameters for touch funnel events.
Was this page helpful?