Capture event and session properties for web frontends

  • Latest Dynatrace
  • How-to guide

Use event and session properties to add custom key-value pairs to user events and user sessions in order to capture business-specific context and tailor monitoring to your goals. For an example of how session properties support business analysis, see Extract a metric from user sessions. This page shows you how to configure these properties for your web frontend and send them using the JavaScript API.

Configure event and session properties

Event and session properties must be configured before they can be used. Incoming event and session properties that are not configured are dropped during event ingest.

To configure an event or session property

  1. Go to Experience Vitals Experience Vitals > Overview.
  2. Select Web to view all web frontends.
  3. Select the frontend you want to configure.
  4. In the Settings tab, select Event and session properties.
  5. Depending on whether you want to configure an event or session property, select Add under either Defined event properties or Defined session properties.
  6. In Field name, specify a name (for example, cart.total_value).
  7. If you want field name validation to be case insensitive, turn on Field name validation should be case-insensitive.
  8. Under Datatype, select one of the available types—either string, boolean, or number.

Event and session properties use the namespaces event_properties and session_properties. Therefore, the configured field name is always prefixed with either event_properties. or session_properties., depending on the selected type, for example event_properties.cart.total_value.

Send event and session properties

As soon as you have configured an event or session property, you can start sending it via the JavaScript API.

Send event properties

When you report events via the JavaScript API using sendEvent or sendExceptionEvent, you can add event properties as parameters. To add event properties to any event—including those reported by the RUM JavaScript itself—use addEventModifier.

When adding an event property, always include the event_properties. prefix.

Send session properties

Session properties are always sent as standalone events. To send a session property, use sendSessionPropertyEvent. To include additional session properties in that event, use addEventModifier.

When sending or adding a session property, always include the session_properties. prefix.

Limits

The following limits apply to event and session properties:

  • A field name can have a maximum length of 100 characters, including the event_properties. or session_properties. prefix.
  • A field name can contain only letters (A–Z, a–z), numbers (0–9), underscores (_), and dots (.).
  • You can configure up to 20 event and session properties.
  • String values can have a maximum length of 1,000 characters.
Related tags
Digital Experience