# Capturing Webpage variable on synthetic monitor step

**URL:** <https://community.dynatrace.com/t/capturing-webpage-variable-on-synthetic-monitor-step/34450>\
**Category:** Synthetic Monitoring\
**Tags:** synthetic-monitoring\
**Created:** [March 11, 2022, 6:20am UTC](https://community.dynatrace.com/t/capturing-webpage-variable-on-synthetic-monitor-step/34450 "2022-03-11T06:20:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpdotcom](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mpdotcom](https://community.dynatrace.com/u/mpdotcom)\
**Post date:** [March 11, 2022, 6:20am UTC](https://community.dynatrace.com/t/capturing-webpage-variable-on-synthetic-monitor-step/34450/1 "2022-03-11T06:20:18Z")

</div>

Do we have a way where I can capture webpage variables upon synthetic script execution?

I have been getting frequent alerts but unable to identify which webserver node is failing. I’m thinking of capturing the webpage variable so we can directly isolate it from the web cluster. Do you think it’s possible?

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [March 11, 2022, 8:30am UTC](https://community.dynatrace.com/t/capturing-webpage-variable-on-synthetic-monitor-step/34450/2 "2022-03-11T08:30:47Z")

</div>

Is this information available somewhere on the page? If so, you could use a JavaScript event to grab the value and then either print it in the logs using, api.info etc or you could fail the monitor with api.fail and print the information in event shown the WebUI. You can find information on JavaScript events [here](https://www.dynatrace.com/support/help/how-to-use-dynatrace/synthetic-monitoring/browser-monitors/browser-clickpath-events#javascript)

---

<div class="post-metadata">

**Author:** ![mpdotcom](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mpdotcom](https://community.dynatrace.com/u/mpdotcom)\
**Post date:** [March 11, 2022, 9:16am UTC](https://community.dynatrace.com/t/capturing-webpage-variable-on-synthetic-monitor-step/34450/3 "2022-03-11T09:16:02Z")

</div>

I tried the api.info and it works if I want to run manually.

Is there a way that I can view the details on script analysis page?

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [March 11, 2022, 11:07am UTC](https://community.dynatrace.com/t/capturing-webpage-variable-on-synthetic-monitor-step/34450/4 "2022-03-11T11:07:22Z")

</div>

No, for HTTP Monitors you can’t currently add information there. If it’s a monitor being run on a private location, you can see messages in the vuc-http-custom.log. Otherwise for a public monitor you could fail the test as you can see the failure message in the Events section on the HTTP Monitor details page.

Otherwise, you could use the events API to send an event to the tenant for this monitor

---

<div class="post-metadata">

**Author:** ![mpdotcom](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mpdotcom](https://community.dynatrace.com/u/mpdotcom)\
**Post date:** [April 1, 2022, 5:41am UTC](https://community.dynatrace.com/t/capturing-webpage-variable-on-synthetic-monitor-step/34450/5 "2022-04-01T05:41:41Z")

</div>

do we have document on how to do this?

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [June 18, 2024, 8:22am UTC](https://community.dynatrace.com/t/capturing-webpage-variable-on-synthetic-monitor-step/34450/6 "2024-06-18T08:22:55Z")

</div>

Api.fail is documented [here](https://docs.dynatrace.com/docs/shortlink/http-monitor-pre-post-script#end)&nbsp;and the events API is documented [here](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/events-v2/post-event)
