# Custom User Action using Javascript variable

**URL:** <https://community.dynatrace.com/t/custom-user-action-using-javascript-variable/18851>\
**Category:** Real User Monitoring\
**Tags:** user-actions, user-sessions, javascript\
**Created:** [December 14, 2018, 10:20am UTC](https://community.dynatrace.com/t/custom-user-action-using-javascript-variable/18851 "2018-12-14T10:20:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rene\_abdon1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rene_abdon1/32/28966_2.png) [@rene\_abdon1](https://community.dynatrace.com/u/rene_abdon1)\
**Post date:** [December 14, 2018, 10:20am UTC](https://community.dynatrace.com/t/custom-user-action-using-javascript-variable/18851/1 "2018-12-14T10:20:08Z")

</div>

Hi wise community members,

I need to configure a Conversion Goal based on a Javascript Variable that I included in Session Properties, obviously this is not possible because I can’t configure a conversion goal based on that, but I can create a Custom User Action (extraction rule) for a JS variable and after create a conversion goal based on this User Action, great.

My point is:

I can see this variable in my user sessions (so session properties is working perfectly):

 ![19179-cua-js1.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/4/346b51c38a76f2d28cd9902096c53d44efad413e.png)

My question is:

What is the regex sintax that I need to fill in my Custom User Action Rule to just include in this action those that have this variable = TRUE?

 ![19180-cua-js2.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/1/9133c3fd59dfd8114f7e55965c3a2626d761415c.png)

Tks my great friends.

😉

---

<div class="post-metadata">

**Author:** ![nva\_dt](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/nva_dt/32/22312_2.png) [@nva\_dt](https://community.dynatrace.com/u/nva_dt)\
**Post date:** [December 21, 2018, 3:19pm UTC](https://community.dynatrace.com/t/custom-user-action-using-javascript-variable/18851/2 "2018-12-21T15:19:23Z")

</div>

Hi Rene, I would use a user action naming rule.

You can give a specific name to the user action containing your JS variable.

Then use that custom name in the definition of your conversion goal.

Let us know if that helps!

---

<div class="post-metadata">

**Author:** ![nva\_dt](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/nva_dt/32/22312_2.png) [@nva\_dt](https://community.dynatrace.com/u/nva_dt)\
**Post date:** [December 21, 2018, 3:22pm UTC](https://community.dynatrace.com/t/custom-user-action-using-javascript-variable/18851/3 "2018-12-21T15:22:59Z")

</div>

Adding some screenshots here:

 ![19250-step-1.png](https://global.discourse-cdn.com/dynatrace/original/2X/6/6f505f8d2e4c7b3de9d2806df1fc5374395d6ec6.png)

 ![19251-step-2.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/d5c47cb40b0b000e268a841bb45270fa2743b9c1.png)
