Configuration & Config Commands

Configuring the tracking SDK

The tracking SDK can be configured at any time by providing an object with the desired settings (see list below). However, some settings like apiKey need to be set as the first command when initialising the SDK.

This is why a configuration command with this configuration is already included in the HTML Snippet (or GTM Tag Template) and it can be expanded with additional configurations.

// Interface:
ce({
  [configuration property]: [value]
  [configuration property]: [value]
});

// Example:
ce({
  silentLogs: true,
  rootDomain: 'example.com'
});

Reading the Configuration

The current configuration and its values can also be read by using a callback command. Note that the configuration can not be changed by manipulating the returned configuration, but must be configured as described above.

To read the current configuration or just insert a custom operation into the command queue, you can use a Callback Command. These take a function as argument, which will inserted and executed via the command queue. The function will be called with an immutable copy of the current (at time of execution) configuration.

// Interface: 
ce(function(configuration) {
  //...
});

// Example:
ce(function(configuration) {
  console.log(configuration.globalUserId)
});

Possible Configuration Properties:

Last updated