目录
此内容是否有帮助?

# Multi-Instance

The multi-APPID feature could create multiple SDK instances to perform data tracking based on their own APPID. That is, you can report data to multiple APPIDs.

Multiple instances share preset device-related attributes (including device ids). Other attributes are not shared:

  • #distinct_id distinct ID
  • #account_id account ID
  • super propert、Dynamic public property
  • timeEvent related event

You can report data to another project by creating a child instance, or to another set of user ids.

// create child instance tt
ta.initInstance("tt");

// set distinct id for child instance
ta.tt.identify("another_distinct_id");

// track event by child instance
ta.tt.track("event_from_tt_instance");

// create subinstances of different configurations
var config = {
  appId: "ANOTHER-APP-ID",
  enablePersistence: true,
};

ta.initInstance("tt_1", config);
ta.tt_1.track("event_from_tt_instance");