# Catch actionId with dtrum for autodetected XHR

**URL:** <https://community.dynatrace.com/t/catch-actionid-with-dtrum-for-autodetected-xhr/41953>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, user-sessions\
**Created:** [October 6, 2023, 7:37am UTC](https://community.dynatrace.com/t/catch-actionid-with-dtrum-for-autodetected-xhr/41953 "2023-10-06T07:37:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [October 6, 2023, 7:37am UTC](https://community.dynatrace.com/t/catch-actionid-with-dtrum-for-autodetected-xhr/41953/1 "2023-10-06T07:37:42Z")

</div>

Hello folks!

I am trying to instrument web app with dtrum now and I have simple question.

I want to add additional information to XHR action (for example “click on&nbsp;purchase”).

Customer really want to save auto-detection XHR actions instead create custom action.

There is no problem to get actionID when we create custom action with dtrum:

```markup
var someactionid = dtrum.enterAction('SomeAction');

```

var&nbsp; **someactionid** &nbsp;will have value of our actionId.

With this we can send additional user action property:

```markup
function addDoubleProperties(actionId) {
dtrum.addActionProperties(actionId, null, null, dbl);
}

```

But what can I do in case that this action not custom - just regular normal autodetected XHR action.

I can’t use workaround to have user session prop instead user action property. I need to have exactly user action prop.

Thanks.

Regards,

Alex Romanenkov

---

<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:** [November 14, 2024, 1:02pm UTC](https://community.dynatrace.com/t/catch-actionid-with-dtrum-for-autodetected-xhr/41953/2 "2024-11-14T13:02:10Z")

</div>

[@Romanenkov\_Al3x](https://community.dynatrace.com/user/51881)&nbsp;- very interesting need. Were you able to come up with any work arounds for this? All I can think of leveraging the action property to capture and set the value per action with the needed clean up rules etc.

---

<div class="post-metadata">

**Author:** ![Fin\_Ubels](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fin_ubels/32/18008_2.png) [@Fin\_Ubels](https://community.dynatrace.com/u/Fin_Ubels)\
**Post date:** [November 15, 2024, 1:06am UTC](https://community.dynatrace.com/t/catch-actionid-with-dtrum-for-autodetected-xhr/41953/3 "2024-11-15T01:06:55Z")

</div>

I believe this could be achieved with action listeners detailed here&nbsp;[https://www.dynatrace.com/support/doc/javascriptapi/interfaces/dtrum\_types.DtrumApi.html#addEnterActionListener](https://www.dynatrace.com/support/doc/javascriptapi/interfaces/dtrum_types.DtrumApi.html#addEnterActionListener)

There is an example of listener usage here&nbsp;[https://community.dynatrace.com/t5/Real-User-Monitoring/The-difference-between-addEnterActionListener-vs/m-p/230078](https://community.dynatrace.com/post/230078)

While this is an old thread, hope this helps!
