Skip to content

Track form submissions

Forms don’t get automatic click handling the way links and buttons do, so track the submit explicitly:

form.addEventListener('submit', () => {
mad.track('form_submitted', { form: 'contact' });
});

Fire it on submit rather than on a success response if you want to capture attempts, not just successes — track a separate event from your success handler if you need both.