Skip to main content

Multiple instances

Last updated 10/03/2026

1. Feature overview​

You can create SDK instances with multiple APP IDs, which we call multiple instances for short. With multiple instances, you can report data to different projects.

2. Create multiple instances​

To create multiple SDK instances, initialize the SDK with different APP IDs:

//Initialize configuration 1
TDAnalytics.init(context, "app-id-1", "https://youserverurl.1.com");

//Initialize configuration 2
TDAnalytics.init(context, "app-id-2", "https://youserverurl.2.com");

//Report an event to configuration 1 (if no app-id is passed, the event is reported to configuration 1 by default)
TDAnalytics.track({
eventName: 'event_from_appid_1'
});
//Report an event to configuration 1 (app-id-1 specified)
TDAnalytics.track({
eventName: 'event_from_appid_1'
}, 'app-id-1');
//Report an event to configuration 2 (app-id-2 specified)
TDAnalytics.track({
eventName: 'event_from_appid_2'
}, 'app-id-2');

Note that each SDK instance must have a different APP ID, and most data is not shared between instances. For details, see Section 3, "Data sharing between instances".

3. Data sharing between instances​

Most APIs are called on instance objects, so most data and settings are not shared among instances with different APPIDs, or between a parent instance and its light instances. However, some data and settings take effect for all instances. The following describes whether each type of data and setting is shared among instances:

  1. Account information
  • Distinct ID #distinct_id generated by the system by default: shared
  • Distinct ID #distinct_id set by calling identify: not shared
  • Account ID #account_id set by calling login: not shared
  1. Event tracking track and user property operations user_set, user_setOnce, user_add, and user_delete: not shared
  2. Super properties setSuperProperties and dynamic super properties setDynamicSuperPropertiesTracker: not shared
  3. Record event duration timeEvent: not shared
Was this page helpful?