Capture lead on mouseover

gerard_reyes Posted by: Gerard Reyes Date Posted: May 19, 2025
Back to Case Studies

Issue

For some reason, there is no code that fires on click of the submit button due to a custom code on the submit button.

Solution

Added the capture event on hover or mouse over of the mouse to the submit button.

document.addEventListener('mouseover', function(event) {
     if (event.target.tagName === 'BUTTON' && event.target.type === 'submit') {

         mcfx(function(tracker) {
             tracker.capture(event.target.closest('form'));
             console.log('MCFX capture success');
         });
     }
});

Achievement

Lead is captured.

Snippet/Screenshot/Link

Task: Link

Code: Screenshot