# User action stringProperties

**URL:** <https://community.dynatrace.com/t/user-action-stringproperties/32012>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, application-monitoring, user-sessions\
**Created:** [July 6, 2021, 11:58am UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012 "2021-07-06T11:58:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [July 6, 2021, 11:58am UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/1 "2021-07-06T11:58:31Z")

</div>

Hi All,

What is the countenance of this metric or properties:

I saw some queries using this parameter but what is the goal and what it contain? useraction.stringProperties.PrblemImpact

Thanks

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [July 7, 2021, 8:20pm UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/2 "2021-07-07T20:20:28Z")

</div>

This is for when a Problem impacts your customers/users so you are able to filter out the user sessions that are impacted by the problem.

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [July 11, 2021, 7:14am UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/3 "2021-07-11T07:14:55Z")

</div>

Thanks&nbsp;[@ChadTurner](https://community.dynatrace.com/user/14877)&nbsp;for your feedback.

My question was for the global variable

useraction.stringProperties.\* what are the informations that we can retrieve with the stringproperties.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [July 11, 2021, 5:34pm UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/4 "2021-07-11T17:34:42Z")

</div>

useractoin.stringProperties.\* are user action properties (defined in the application settings) captured by Dynatrace. For web applications, it can have several sources such as CSS selectors, server side request variables, javascript variables…

In general, it allows you to put additional arbitrary metadata for your useractions to be used when analyzing user sessions, generating reports, dashboards or doing user segmentation.

---

<div class="post-metadata">

**Author:** ![Viachaslau](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@Viachaslau](https://community.dynatrace.com/u/Viachaslau)\
**Post date:** [July 20, 2022, 12:45pm UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/5 "2022-07-20T12:45:42Z")

</div>

Do we have hands on examples for this? e.g how to attach JS variable to user action

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [July 20, 2022, 12:59pm UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/6 "2022-07-20T12:59:31Z")

</div>

[@Viachaslau](https://community.dynatrace.com/user/47500)&nbsp;  
Just define the action property in the web application like this:

 ![Julius_Loman_0-1658321899878.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/0/e051a5f8ec7e372996f774fa17c2b9a48124fca6.png)

Then the JS variable will be captured at the end of the user action. Keep in mind the key cannot be changed after it’s defined and the key/name are global across all web applications.

---

<div class="post-metadata">

**Author:** ![Viachaslau](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@Viachaslau](https://community.dynatrace.com/u/Viachaslau)\
**Post date:** [July 20, 2022, 2:06pm UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/7 "2022-07-20T14:06:27Z")

</div>

Thank you, this dynatrace part and it is pretty clear.  
I mean from application code how this bindings works?  
can we place just inline **var foo = “abc”** in button \<div\> and it will work?

because I see a lot for customisation for dtrum way which I want to **avoid:**

```auto
// LONG PROPERTIES<br>var long = {long_one: 34234, long_two: 1234567};<br>function addLongProperties (actionId) {<br> dtrum.addActionProperties(actionId, long);<br>}<br>function addLongPropertiesOnEnter () {<br> if (typeof dtrum === "undefined") return;<br><br> var long = {long_one: 34234, long_two: 1234567};<br><br> dtrum.addEnterActionListener(addLongProperties);<br> loadData();<br> dtrum.removeEnterActionListener(addLongProperties);<br>}

```

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [July 20, 2022, 2:49pm UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/8 "2022-07-20T14:49:30Z")

</div>

It depends - I’d go with the dtrum.addActionProperties instead of setting global javascript variables, it’s better to read the code.  
Remember - it must be **a** &nbsp; **global** variable. So likely window.foo = ‘ABC’ will work for you. I used for example window.dt.foo, so I won’t abuse much the window object.

---

<div class="post-metadata">

**Author:** ![Viachaslau](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@Viachaslau](https://community.dynatrace.com/u/Viachaslau)\
**Post date:** [July 20, 2022, 2:57pm UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/9 "2022-07-20T14:57:57Z")

</div>

dtrum is as good way but for us will be fallback scenario.

We aim to use only JS vars.

My question how the variable initiation timing affect property detection.

If we assign variable value after XHR request (sometimes we get values from response)  
Will it be attached to action, or we should to assign value before onclick/submit?

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [July 20, 2022, 8:23pm UTC](https://community.dynatrace.com/t/user-action-stringproperties/32012/10 "2022-07-20T20:23:38Z")

</div>

It’s perfectly safe to get it after the XHR - for example in the callback. It really depends on how the processing is done in the app. If you are using setTimeout for processing, don’t forget to enable it in the application definition too.
