# How do I create web application detection rule using Target URL (Application uses Javascript API)

**URL:** <https://community.dynatrace.com/t/how-do-i-create-web-application-detection-rule-using-target-url-application-uses-javascript-api/35697>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, application-detection\
**Created:** [June 30, 2022, 6:50pm UTC](https://community.dynatrace.com/t/how-do-i-create-web-application-detection-rule-using-target-url-application-uses-javascript-api/35697 "2022-06-30T18:50:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saravanakumar\_P](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/saravanakumar_p/32/19257_2.png) [@Saravanakumar\_P](https://community.dynatrace.com/u/Saravanakumar_P)\
**Post date:** [June 30, 2022, 6:50pm UTC](https://community.dynatrace.com/t/how-do-i-create-web-application-detection-rule-using-target-url-application-uses-javascript-api/35697/1 "2022-06-30T18:50:47Z")

</div>

Hi Team,

I was trying to separate web application from a global application, I logged in to the global web application and click on myapp link -&nbsp;JavaScript API’s is getting triggered.

I am seeing useraction in Dynatrace(global web application) with below details

XHR action: **/path/someportal/action/navigations**

**Target URL: [https://www.somedomain.com/path/someportal/action/\*\*navigations/#/myapp\*\*/reports](https://www.somedomain.com/path/someportal/action/**navigations/#/myapp**/reports)**

I have tried to create rule with web application URL contains “navigations/#/myapp” but the traffic is not getting captured in the web application.

Could anyone face the similar issue? Is there any RFE planned already to capture Target URL as web application detection rule?

---

<div class="post-metadata">

**Author:** ![Super](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/super/32/7467_2.png) [@Super](https://community.dynatrace.com/u/Super)\
**Post date:** [June 30, 2022, 8:15pm UTC](https://community.dynatrace.com/t/how-do-i-create-web-application-detection-rule-using-target-url-application-uses-javascript-api/35697/2 "2022-06-30T20:15:33Z")

</div>

Try to use request attribut for solve this issue

---

<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 1, 2022, 6:58am UTC](https://community.dynatrace.com/t/how-do-i-create-web-application-detection-rule-using-target-url-application-uses-javascript-api/35697/3 "2022-07-01T06:58:12Z")

</div>

Detection rules consider the URL you have in your browser. Simply said, it’s only for the load actions.

In your case, the XHR action will still be an action in the application determined by rules which apply to the Load action of the page where the XHR is performed from. You should give your XHR action a proper name. If you have trouble with the naming - (if you can’t write a good naming rule for that action in particular), you can use the [DTRUM API](https://www.dynatrace.com/support/doc/javascriptapi/interfaces/dtrum_types.DtrumApi.html) to set the name from your JavaScript code.
