Skip to main content
Skip table of contents

Submitting custom events

In addition to the standard analytics events automatically tracked (if enabled) by the customer implementation, the platform allows customers to track custom events via the API using the Customizer JavaScript client library.

Prerequisite: Customizer Implementation Flow

The sections below assume familiarity with the Customizer implementation flow. As a brief recap, most implementations maintain an instance of a Controller class, which serves as the primary entry point for interacting with the configurator APIs.

Configure global event variables

Controller’s trackSharedActionParameters method allows to configure variable values that will be automatically included with every follow up event submission. This method does not submit events by itself.

Method parameters: Controller.trackSharedActionParameters(map), where map parameter is a name/value list of shared variable values.

Parameter names can be in either PascalCase or camelCase.

For example:

JS
controllerInstance.trackSharedActionParameters({
    page: 'Configurator',
    region: 'EMEA',
});

Submit event

Controller’s trackAction method allows submitting an event along with its related variables. The definition and meaning of each custom event and its variables are determined by the customer. For a complete list of available action data point parameters and their suggested usage, please refer to the Actions data points.

If a product does not have analytics processing enabled, the event will not be submitted to Customizer. However, the integration event will still be fired, which allows customers to integrate third-party analytics packages as described in Integrating third-party analytics

Method parameters: Controller.trackAction(map), where map parameter is a name/value list of event parameters.

For example:

CODE
controllerInstance.trackAction({
    event: 'click',
    screen: 'intro',
    button: 'get-started',
});

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.