# Monitor "Page Leave" event in user session

**URL:** <https://community.dynatrace.com/t/monitor-page-leave-event-in-user-session/42400>\
**Category:** Real User Monitoring\
**Tags:** user-sessions\
**Created:** [November 1, 2023, 9:04am UTC](https://community.dynatrace.com/t/monitor-page-leave-event-in-user-session/42400 "2023-11-01T09:04:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KVZ](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@KVZ](https://community.dynatrace.com/u/KVZ)\
**Post date:** [November 1, 2023, 9:04am UTC](https://community.dynatrace.com/t/monitor-page-leave-event-in-user-session/42400/1 "2023-11-01T09:04:52Z")

</div>

I have a requirement to monitor when a user closes a page they’re on.

I see in JavaScript there’s&nbsp;visiblitychange&nbsp;,&nbsp;pagehide&nbsp; and&nbsp;beforeunload&nbsp;but I didn’t find a way I can use those in Dynatrace.

Does anyone know how I can use these, or of any other way to monitor when a user closes a page?

---

<div class="post-metadata">

**Author:** ![RazTN7](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/raztn7/32/10208_2.png) [@RazTN7](https://community.dynatrace.com/u/RazTN7)\
**Post date:** [November 2, 2023, 8:38am UTC](https://community.dynatrace.com/t/monitor-page-leave-event-in-user-session/42400/2 "2023-11-02T08:38:32Z")

</div>

Hey hi,  
If you know the Javacript variable or other payload for pageleave or page out case the you can use it as user action placeholders.

Check below screenprint.

 ![RameshN_0-1698914223271.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/1/01f15fcd54dd1f68637a62960ce07cd4dca1b52e.png)

Cheers!

RN
