Skip to main content

Advanced guide

Last updated 10/03/2026

1. Initialization parameters​

The parameters passed in during initialization are described below

Property nameTypeDescription
appIdStringapp id of the project created in the AE backend
serverUrlStringserver url of the project created in the AE backend
modeStringSDK running mode (none, debug, debugOnly)
enableLogBooleanWhether to enable log printing
zoneOffsetNumberDefault time zone of the SDK
enableBatchBooleanWhether to enable batch reporting of cached events
batchConfigobjectBatch reporting configuration
autoTrackobjectAuto-tracking settings
triggerListenerfunctionNotifies you of trigger results

2. Set client parameters​

When you create a client-triggered task, you can fill in Client-side Conditions. For configuration details, see Create client-triggered tasks

The parameters available in Client-side Conditions come from the environment parameters that the client collects automatically and the client parameters that you set through the TDStrategy SDK. After you SET custom client parameters through the APIs provided by the TDStrategy SDK, you can add them to the AE backend and use them in operation tasks.

Note: The names and types of the parameters you SET on the client must match the client parameters configured in the AE Engage backend.

Configure client parameters as follows

var TDRemoteConfig = require("./tdremoteconfig.mg.wx.min.js");
// Set client parameters. If you set them multiple times, the union is used
TDRemoteConfig.addClientParams({
"key":"value"
});

3. Touch funnel events​

When you create a client-triggered channel, you can enable the touch funnel settings. For configuration details, see Channel Settings

After you enable the touch funnel, you can configure the event names associated with the funnel steps. You can then view the conversion data of the configured steps on the data details page of operation tasks that use this channel.

Events selected for Delivered and Clicked must meet the following requirements:

  • The event must carry Engage-specific parameters. You can get these parameters from the opsProperties property of the TDStrategyResult object in the push content, and report them as follows:
var TDApp = require("./tdcore.mg.wx.min.js");
var TDAnalytics = require("./tdanalytics.mg.wx.min.js");
TDApp.init({
appId: "AppId",
serverUrl:"ServerUrl",
enableLog:true,
triggerListener:function(result){
TDAnalytics.track({
eventName: "ops_click",
properties: result.opsProperties
});
}
});

4. Send Test​

To quickly verify the availability of a channel and the validity of a task, the SDK supports a test mode.

var TDApp = require("./tdcore.mg.wx.min.js");
TDApp.init({
appId: "AppId",
serverUrl:"ServerUrl",
enableLog:true,
debugMode: "debug",//Set test mode
triggerListener:function(result){

}
});

After you enable debug mode on the client, the client fetches test tasks every 5s. In the AE Engage module, you can create channel tests or task tests. While a task is waiting to be triggered, you can watch the progress nodes on the frontend page.

Related documentation: Send Test for tasks, Send Test for channels

Send tests for client-triggered tasks require test devices. You can select or add test devices in the test device list

5. Customize Fetch parameters​

Fetch parameters are parameters that the client SDK can use when it requests values from the AE server. You can customize Fetch parameters and add them as Environment Parameters of config channels.

5.1 Add​

//Specify the customFetchParams parameter during initialization
TDApp.init({
appId: "AppId",
serverUrl:"ServerUrl",
enableLog:true,
customFetchParams:{
}
});
//Or call setCustomFetchParams
TDStrategy.setCustomFetchParams({});

5.2 Delete​

Delete by the specified key

TDStrategy.removeCustomFetchParam("key");
Was this page helpful?