# Synthetic Clickpath: Bypass an event

**URL:** <https://community.dynatrace.com/t/synthetic-clickpath-bypass-an-event/45592>\
**Category:** Synthetic Monitoring\
**Tags:** synthetic-monitoring\
**Created:** [May 15, 2024, 9:21am UTC](https://community.dynatrace.com/t/synthetic-clickpath-bypass-an-event/45592 "2024-05-15T09:21:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![munawarhossain1](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@munawarhossain1](https://community.dynatrace.com/u/munawarhossain1)\
**Post date:** [May 15, 2024, 9:21am UTC](https://community.dynatrace.com/t/synthetic-clickpath-bypass-an-event/45592/1 "2024-05-15T09:21:28Z")

</div>

Hello,

Can synthetic monitor bypass an event?

Example - I’ve a monitor with 14 events (page by page recorded) now I want a page not to be monitored. Say page 10.

From page 9 synthetic will jump to page 11 as on the page 10 we’ve added reCAPTCHA validation, where synthetic bot won’t be able to make & will lead to failure. Creating a false positive problem. Whereas the LIVE site would be fine.

Please assist.

Thanks

---

<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:** [May 15, 2024, 9:25am UTC](https://community.dynatrace.com/t/synthetic-clickpath-bypass-an-event/45592/2 "2024-05-15T09:25:42Z")

</div>

If it’s an event that you will never use, I would just delete it. Otherwise you can add a Javascript event in to check if the event is needed and if it’s not skip it using on of the skip clickpath events options documented [here](https://docs.dynatrace.com/docs/platform-modules/digital-experience/synthetic-monitoring/browser-monitors/browser-clickpath-events#javascript-event-api)

Skip clickpath events

These methods skip events after completion of the current event.

- `api.skipNextSyntheticEvent()`—Skips execution of the next event.
- `api.skipNextSyntheticEvents(n)`—Skips execution of the next&nbsp;`n`&nbsp;consecutive events.
- `api.skipSyntheticEvent(eventIndex)`—Skips execution of the event with the index&nbsp;`eventIndex`. Event index numbers start at&nbsp;`1`&nbsp;and match the event numbers displayed in the web UI.
- `api.skipSyntheticEvents(eventIndexes)`—Skips execution of multiple events; the array&nbsp;`eventIndexes`&nbsp;specifies the indexes of events to skip, for example,&nbsp;`api.skipSyntheticEvents([8, 9])`.

---

<div class="post-metadata">

**Author:** ![munawarhossain1](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@munawarhossain1](https://community.dynatrace.com/u/munawarhossain1)\
**Post date:** [May 15, 2024, 9:41am UTC](https://community.dynatrace.com/t/synthetic-clickpath-bypass-an-event/45592/3 "2024-05-15T09:41:00Z")

</div>

Thanks Hannah

As per my example, if the event in b/w the sequence is deleted. It will mark&nbsp;my journey as failed.

Secondly - where to enter this&nbsp;api.skipNextSyntheticEvent()? is it in the script?

---

<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:** [May 15, 2024, 9:45am UTC](https://community.dynatrace.com/t/synthetic-clickpath-bypass-an-event/45592/4 "2024-05-15T09:45:41Z")

</div>

I’m not sure I understand. Do you need the event to be executed or skipped?

---

<div class="post-metadata">

**Author:** ![munawarhossain1](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@munawarhossain1](https://community.dynatrace.com/u/munawarhossain1)\
**Post date:** [May 15, 2024, 9:50am UTC](https://community.dynatrace.com/t/synthetic-clickpath-bypass-an-event/45592/5 "2024-05-15T09:50:35Z")

</div>

Skipped

---

<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:** [May 15, 2024, 10:06am UTC](https://community.dynatrace.com/t/synthetic-clickpath-bypass-an-event/45592/6 "2024-05-15T10:06:44Z")

</div>

So, if you always want to skip it, I would just delete the event. Otherwise you are adding an extra event in just to say ‘skip the next event’.&nbsp;  
If you might need the event to be executed in only certain circumstances then you can add a JavaScript event before the one you want to skip which can test whether it should be skipped or not

```markup
// Choose whether to skip next event
var element = document.getElementById("CSS ID of the relevant element");

// Check to see if the element exists
if (element === null) {
    // Element not found so skip the next event
    api.skipNextSyntheticEvent();
} else {
    // Element found, continue to execute next event
}

```
