# ClickstreamTraceConfig

**Kind**: interface | **Module**: [Insights](https://docs.interop.io/browser/reference/javascript/insights/index.md)

**Source**: https://docs.interop.io/browser/reference/javascript/insights/clickstreamtraceconfig/index.html

Configuration for Clickstream trace behavior.
Controls how user interaction events are tracked and organized in traces.

## Properties

- **`descriptiveName`** (`boolean`, optional) default: `true`
  If `true`, the Clickstream trace spans will be named interopio.api.clickstream.<applicationName>.<event>
  If `false`, the Clickstream trace spans will be named interopio.api.clickstream.<event>
- **`enabled`** (`boolean`, required)
  Whether the Clickstream trace is enabled.
- **`events`** (`string[]`, optional) default: `["click"]`
  List of DOM event names to capture as Clickstream trace spans.
- **`nestEventHandlersEagerly`** (`boolean`, optional) default: `false`
  If `true`, the io.Insights pre-init module (early.js, loaded from a preload script or an
  inline snippet before the application code) eagerly patches addEventListener at page start,
  so that listeners registered before io.Connect initialized also participate in
  `nestEventListeners` nesting. Without it, only listeners attached after initialization
  can be nested - and a listener that missed wrapping at registration stays unwrapped for
  every later dispatch.

  The flag is read by the pre-init module itself from the platform-provided configuration
  at `window.glue42gd.insights` (which mirrors this configuration object), so it has no
  effect when the pre-init module is not installed or when running outside io.Connect
  Desktop. The eager wrappers are inert pass-throughs until the SDK initializes, and remain
  inert if the SDK loads with clickstream or `nestEventListeners` disabled.
- **`nestEventListeners`** (`boolean`, optional) default: `true`
  If `true`, io.Insights will try to nest spans from other event listeners for the same event under
  the Clickstream span. This is not guaranteed to always work due to specifics of how browsers execute
  event listeners, and will only work for listeners attached after io.Connect was initialized -
  unless `nestEventHandlersEagerly` is also enabled.
- **`structure`** (`"sibling" | "nested"`, optional) default: `"sibling"`
  If `sibling`, all spans in the Clickstream trace will be nested under the same
  root span. This is useful when working with visualization interfaces that do not handle
  arbitrarily nested spans.

  If `nested`, every span in the Clickstream trace will be nested under the previous span.
  This is useful for some kinds of querying.
