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. Sign-up 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.