Skip to main content

Multiple instances

Last updated 10/03/2026

1. Create multiple instances​

If you want to send data to multiple projects in your business, you can use the multiple instances feature that we provide.

To create multiple SDK instances, initialize the SDK with different project information.

//Initialize multiple instances
TDConfig tdConfig_1 = new TDConfig(appId_1, serverUrl_1);
TDConfig tdConfig_2 = new TDConfig(appId_2, serverUrl_2);
//Initialize the first instance
TDAnalytics.Init(tdConfig_1);
//Initialize the second instance
TDAnalytics.Init(tdConfig_2);
//Track data with multiple instances
Dictionary<string, object> properties = new Dictionary<string, object>(){
{"product_name", "Product Name"}
};
//Report data with the first instance
TDAnalytics.Track("product_buy", properties, appId_1);
//Report data with the second instance
TDAnalytics.Track("product_buy", properties, appId_2);
//If no project ID is passed, the first instance is used to report data by default
TDAnalytics.Track("product_buy", properties);

The distinct ID, account ID, super properties, and so on are not shared among projects. You need to set them separately for each APP ID instance.

2. Create a light instance​

//First, create an SDK instance
TDAnalytics.Init("APPID", "SERVER");
//Then call LightInstance to create a light instance
string lightKey = TDAnalytics.LightInstance();
//Next, use lightKey to set the login information and report events
TDAnalytics.Login("123ABCabc@thinkingdata.cn", lightKey);
TDAnalytics.Track("some_event", lightKey);

A light instance shares the APPID, reporting URL, and some settings with its parent instance, but other information isn't shared.

Was this page helpful?