Skip to main content
All CollectionsAdvancedJavascript
Before-tracked-click Event
Before-tracked-click Event
Updated over 2 months ago

The before-tracked-click event is fired before the conversion of a popup. This is one of the various events Wisepops can trigger as part of our JS callbacks feature.

A click on the following elements can trigger the before-tracked-click event, if the “track click” option is enabled:

  • Call-to-action

  • 2 Calls-to-action

  • Image

  • Link in text block

Additionally, links in HTML blocks with the class wisepops-track-click will also trigger it. Signup forms won't trigger this event (see before-form-submit).

Prevent popup conversion

The conversion of the popup can be prevented by calling preventDefault() on the event:

wisepops('listen', 'before-tracked-click', function(event) {
event.preventDefault();
});

Preventing this event will have the following consequences:

  • The action won't happen (load new page, scroll to anchor, close popup)

  • The condition "Stop showing after click" won't be met

  • The Clicks counter won't be incremented

  • The after-tracked-click event won't be fired

Event target

The targeted element (event.target) is the same element as the native click event target.

Did this answer your question?