# Custom User Action Not working elementIdentifier

**URL:** <https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, user-actions\
**Created:** [August 28, 2023, 7:05am UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383 "2023-08-28T07:05:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![abnerlusung](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@abnerlusung](https://community.dynatrace.com/u/abnerlusung)\
**Post date:** [August 28, 2023, 7:05am UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/1 "2023-08-28T07:05:45Z")

</div>

Hi all,

I need help to troubleshoot why&nbsp;Custom User Action Not working for&nbsp;{elementIdentifier (default)}

Here are my steps:

1. I’ve added the&nbsp; data-dtname  
\<input data-dtname=“Firstname Text Input” type=“text” value=“firstname” name=“firstname” title=“Firstname” id=“txtFirstname” /\>
2. Added naming rule for Custom Actions&nbsp;  
{customActionName (default)} on {elementIdentifier (default)}  
Conditions,&nbsp;{elementIdentifier (default)} contains Firstname

But unable to be captured.&nbsp; Thank you.

Regards,

Abner

---

<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:** [August 28, 2023, 7:35am UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/2 "2023-08-28T07:35:56Z")

</div>

Custom actions are action which are created using the [JavaScript RUM API](https://www.dynatrace.com/support/doc/javascriptapi/interfaces/dtrum_types.DtrumApi.html)&nbsp;with [enterAction](https://www.dynatrace.com/support/doc/javascriptapi/interfaces/dtrum_types.DtrumApi.html#enterAction) / [leaveAction](https://www.dynatrace.com/support/doc/javascriptapi/interfaces/dtrum_types.DtrumApi.html#leaveAction)&nbsp;methods. Dynatrace can automatically capture only user actions (Load or XHR) which trigger a network call. The data-dtname has also effect only on the automatically captured actions (Load or XHR).

---

<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:** [August 28, 2023, 7:38am UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/3 "2023-08-28T07:38:00Z")

</div>

Hello,&nbsp;Abner.

You need to use another tab (Load actions/XHR actions) instead Custom Actions.

Applications \> App\_Name \> Settings \> User actions (in Capturing)

 ![Romanenkov_Al3x_0-1693208427060.png](https://global.discourse-cdn.com/dynatrace/original/2X/c/c6d93d8e9690432d03dbd3f2ceb2dd8c9aaa87b6.png)

“Custom Actions” tab is only about instrumented actions with JS API (dtrum)

Regards,

Alex Romanenkov

---

<div class="post-metadata">

**Author:** ![abnerlusung](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@abnerlusung](https://community.dynatrace.com/u/abnerlusung)\
**Post date:** [August 28, 2023, 8:03am UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/4 "2023-08-28T08:03:52Z")

</div>

Hi Julius\_Loman,

Thanks so much for your answer.

It means the data-dtname is only for Load and XHR.

What happens if there are multiple data-dtname in one page?

Regards,

Abner

---

<div class="post-metadata">

**Author:** ![abnerlusung](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@abnerlusung](https://community.dynatrace.com/u/abnerlusung)\
**Post date:** [August 28, 2023, 8:06am UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/5 "2023-08-28T08:06:03Z")

</div>

Hi Romanenkov\_Al3x,

I actually tried it with dtrum using enteraction and leaveaction on my button.

Mr. Julius Loman said, it’s only for Load and XHR.

Correct me if I’m wrong but , that I cannot use the Custom with the&nbsp;elementIdentifier?

Regards,

Abner

---

<div class="post-metadata">

**Author:** ![Slawa](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Slawa](https://community.dynatrace.com/u/Slawa)\
**Post date:** [August 28, 2023, 12:10pm UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/6 "2023-08-28T12:10:02Z")

</div>

No, you can’t - because it’s not sent, custom action sent instead. So no data for this placeholder.  
But you can change your custom action name pattern if want to have a similar view to OOB actions.

---

<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:** [August 28, 2023, 7:10pm UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/7 "2023-08-28T19:10:45Z")

</div>

No, custom actions use the name sent using the enterAction method. data-dtname is only for the automatically generated actions (load/xhr).

---

<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:** [August 28, 2023, 7:15pm UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/8 "2023-08-28T19:15:49Z")

</div>

For Load and Xhr actions Dynatrace takes data-dtname attribute on the element the user interacts with. However you might want to use the uanpi custom parameter also for DOM traversal with the limit of parent elements which Dynatrace will look at. Just use a reasonable value such as uanpi=5 to traverse up to 5 parent elements to look for the data-dtname attribute (or a custom name).

---

<div class="post-metadata">

**Author:** ![djpatel9](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@djpatel9](https://community.dynatrace.com/u/djpatel9)\
**Post date:** [September 11, 2024, 6:13pm UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/9 "2024-09-11T18:13:18Z")

</div>

Hi Julius,

How do I set uanpi = 5? Is this a setting somewhere in dynatrace?

---

<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:** [September 12, 2024, 6:40pm UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/10 "2024-09-12T18:40:14Z")

</div>

[@djpatel9](https://community.dynatrace.com/user/80561)&nbsp;yes, now it’s located in the Web application in&nbsp;Settings \>&nbsp;Capturing \>&nbsp;Custom configuration properties

 ![Julius_Loman_0-1726166402116.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/3/c3ed55d2add710195fa92f8a1ee2ed62094716e8.png)

---

<div class="post-metadata">

**Author:** ![djpatel9](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@djpatel9](https://community.dynatrace.com/u/djpatel9)\
**Post date:** [September 17, 2024, 4:51pm UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/11 "2024-09-17T16:51:51Z")

</div>

Perfect! Worked like a charm. Are there any attributes we can use to potentially let dynatrace know about a load action? As I understand the data-dtname only works on inputs or clickable items?

---

<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:** [September 19, 2024, 6:45am UTC](https://community.dynatrace.com/t/custom-user-action-not-working-elementidentifier/41383/12 "2024-09-19T06:45:38Z")

</div>

1. You can change the attribute name and you can use multiple attributes instead of just data-dtname.
2. If user does not interact with an elemenent - e.g. enters the URL directly in browser or load action happens automatically (redirect?), then you must use either user action naming rule for the Load actions or you must use the dtrum API - [actionName](https://www.dynatrace.com/support/doc/javascriptapi/interfaces/dtrum_types.DtrumApi.html#actionName)&nbsp;to set the name.
