# Javascript API:  how to use with cascading XHRs

**URL:** <https://community.dynatrace.com/t/javascript-api-how-to-use-with-cascading-xhrs/30809>\
**Category:** Open Q&A\
**Tags:** javascript\
**Created:** [March 16, 2021, 3:58pm UTC](https://community.dynatrace.com/t/javascript-api-how-to-use-with-cascading-xhrs/30809 "2021-03-16T15:58:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://community.dynatrace.com/u/danielbr)\
**Post date:** [March 16, 2021, 3:58pm UTC](https://community.dynatrace.com/t/javascript-api-how-to-use-with-cascading-xhrs/30809/1 "2021-03-16T15:58:24Z")

</div>

Hi,

We have a webapp with pages that generate many many cascading XHRs.&nbsp;  
We’d like to have an implementation that could give us the performance of those pages.

Even having used the “Extend action durations with cascading timed actions”, the auto UA capturing did not help us.&nbsp; So we’re considering a suitable custom-actions implementation.

I’d like to ask:

1)&nbsp; Can a custom action implementation (using: dtrum.enterAction(..)&nbsp; / dtrum.leaveAction(action)) live side by side with the auto-UA-mechanism?&nbsp; &nbsp;  
-In appmon we actually had to turn it off because the ‘currently active user action’ was erratic and requests would be scattered inconsistently between the custom UA and the auto mechanism’s UA.

2) Can the auto-UA-mechanism be disabled?&nbsp; How do I do that?  
\*without disabling the auto-injection itself.

3) What’s the best way to group those XHRs together?  
Currently considering using something of this sort:

actionId = dtrum.enterAction(“my page load”)

dtrum.enterXhrCallback(actionId)

…

dtrum.leaveXhrCallback(actionId)

.

.

.

dtrum.leaveAction(actionId);

Thanks,

Daniel

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [March 17, 2021, 7:23am UTC](https://community.dynatrace.com/t/javascript-api-how-to-use-with-cascading-xhrs/30809/2 "2021-03-17T07:23:13Z")

</div>

Hi Daniel,

1) As far as I know, if you are adding custom actions on events that the content capture setting will catch, then you need to switch off the the automatic action detection.

2) You can use&nbsp;&nbsp;to&nbsp;enables or disables automatic action detection

 ![Yosi_Neuman_0-1615963547046.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/8/48813ebdbf4b3fcd6a8cd76882df2fc93b66a03e.png)

3) You can check also if the use of&nbsp; **enterXhrAction** with xmode=2 will do the trick of adding subaction

 ![Yosi_Neuman_0-1615964709264.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/39314336024edf16397355657d7069de4a4a9513.png)

HTH

Yos
