Define user action and session properties

Dynatrace allows you to define custom string, numeric, and date properties for your monitored user actions and user sessions. Property values are then captured as part of each of your users’ journeys. Property values can be leveraged for unrivaled visibility into all the details of your users’ interactions with your application.

Below you can find the steps for defining such properties as well as related examples. To acquire a deeper understanding of how to use the session properties, visit Leverage user session properties.

Note: Currently, Dynatrace supports defining session and action properties for web applications only.

How to define action and session properties

User action and session properties are specific to each application. To define a property

  1. Navigate to Settings > Applications and select your application.

  2. Click the Browse () in the top left corner and select Edit.

  3. From the menu on the left select Session and user action properties.

  4. Click Add property.

  5. Select CSS selector, JavaScript variable, JavaScript API, Meta tag, or Cookie value for the capture type and define whether the data you want to capture is of data type String, Date (Date is only available when the capturing is done via JavaScript API) or number (Double or Long).

  6. For all expression types, you need to specify a Key, which is essentially the name of the property. For the JavaScript API, Key is particularly necessary, because if you try to send property data via the JavaScript API without having defined the Key value, the request will be ignored and the property won't appear in the UI.

  7. Optionally, define a Display name for the property to be used in the UI.

  8. To specify whether the property will be stored as a user action or a user session one, activate the corresponding option. If you activate the session option, the last time the JavaScript tag captures the value, this value will then be stored in the defined property on a session level. If you enable the user action option, then for each user action where the JavaScript tag is able to retrieve the data, the data will be stored in the defined property on a user action level. If you activate both, the data will be stored in the defined property on both levels, session and user action.

  9. In case you want to restrict the captured values, you can define a clean-up rule for the property by enabling Apply cleanup rule and specifying a regular expression. The regex will be applied to the captured value, which means that if you try to capture a string that is for example 1000 characters long, only the first 100 characters will be captured and the regex will be applied to these 100 characters.

  10. Click Save property.

Examples

Here are some sample definitions that work for our easyTravel Customer Frontend sample application.

  • In this example, the property member_status captures loyalty program membership status.

    user session properties

  • The numeric property averagepersonprice captures the average price per person of a journey booked using easyTravel.

    user session properties

  • The property author captures the name of the developer of the easyTravel application from a metadata tag.

    user session properties

  • In the example below, a JavaScript string variable captures the user’s appversion during the session.

    user session properties

Use case

You can integrate Adobe Analytics with Dynatrace to facilitate collaboration among the different teams in your business. To find out how you can do this, visit Tightening the communication within BizDevOps with Adobe Analytics & Dynatrace.

Limitations

  • The number of properties is limited to 10 string, 5 numeric, and 5 date properties per application.

  • Properties in date format will only be available for capture via the RUM and JavaScript API.

  • Property capture begins only after enablement of specific property capture rules.

  • String properties are limited to a 100 characters before applying the clean-up rule.