Skip to content

Track User Actions

Browser monitoring automatically detects user interactions and provides deep insights into user behavior without requiring manual instrumentation of every click in your application.

You can achieve the following goals:

  • Understand the performance of key interactions (e.g., clicking an action button)
  • Quantify feature adoption
  • Identify the steps leading to a browser error

Control Action Collection

The trackUserInteractions initialization parameter enables the collection of user clicks within the application. This means that sensitive and private data contained on the page might be included to identify the elements the user interacts with.

Track User Interactions

The RUM SDK automatically tracks clicks. A click action is created if all of the following conditions are met:

  • Activity is detected after the click, i.e., the page is in an active state.
  • The click does not cause a new page to load (in which case the RUM SDK generates another RUM View event).
  • An Action name can be retrieved.

Action Metrics

Metric Type Description
action.duration number(ns) The loading time of the action.
action.action_long_task_count number The count of all long tasks collected for this action.
action.action_resource_count number The count of all resources collected for this action.
action.action_error_count number The count of all errors collected for this action.

The RUM SDK calculates the action loading time by listening for page activity after each click. The action is considered complete when there is no more activity on the page.

Action Attributes

Attribute Type Description
action.action_id String The UUID of the user action.
action.action_type String The type of the user action. For custom user actions, it is set to custom.
action.action_target String The element the user interacted with. Only applicable to automatically collected actions.
action.action_name String A user-friendly name (e.g., "Click on #checkout"). For custom user actions, the action name given in the API call.

Action Names

The RUM SDK uses various strategies to obtain names for click actions. If you want more control, you can define a data-guance-action-name attribute on the clickable element (or any of its parent elements).

For example:

<a class="btn btn-default" href="#" role="button" data-guance-action-name="Test Button">Click me!</a>

Using the actionNameAttribute initialization parameter, you can add a custom attribute to an element to specify the action name.

For example:

   window.DATAFLUX_RUM.init({
     ...
     trackUserInteractions: true,
     actionNameAttribute: 'data-custom-name',
   ...
   })

<a class="btn btn-default" href="#" role="button" data-custom-name="Click Button">Click me!</a>

If both attributes exist on an element, data-guance-action-name takes precedence.

Custom Actions

To extend user Action data, use the addAction API to create custom Actions.

Feedback

Is this page helpful? ×