Skip to main content

Real-time debugging

Last updated 10/02/2026

While integrating the SDK, you can debug in real time by viewing the SDK logs in the IDE console or by using the Debug feature of AE.

1. Print SDK logs​

You can set enableLog to true when initializing the SDK to turn on SDK logging. Once it is on, the reported data is printed to the browser console.

var config = {
appId: "YOUR_APPID",
serverUrl: "YOUR_SERVER_URL",
enableLog:true
};

2. Enable Debug mode​

Enabling Debug mode takes the following two steps:

  1. Enable Debug mode on the client

The following sample code enables Debug mode on the client:

/*
Set the run mode to Debug mode
none: Data is cached and reported according to a caching strategy. This is the default (NORMAL) mode. Recommended for the production environment
debug: Data is reported one record at a time. Problems are reported to the user through logs and exceptions. Not recommended for the production environment
debugOnly: Data is only validated and not stored. Not recommended for the production environment
*/
var config = {
appid: "YOUR_APPID",
server_url: "YOUR_SERVER_URL",
debugMode: "debug"
};
TDAnalytics.init(config);
  1. Add the Debug device in AE

To prevent Debug mode from going live in the production environment, Debug mode can only be enabled on specified devices. Debug mode can be enabled only on devices that have Debug mode enabled on the client and whose device IDs have been added on the Data → Tracking → Debugger page in the AE backend. To add a device, click Add test device in the upper-right corner of the page, click New device in the Select device drawer, and enter the device ID.

You can get the device ID in the following three ways:

  • The #device_id property in the event data in AE
  • Client logs: The SDK prints the DeviceId after initialization completes
  • Call the instance API: Get the device ID

Debug mode may affect data collection quality and App stability. Use it only to verify data during integration, and don't use it in the production environment.

Was this page helpful?