document.addEventListener('wpcf7mailsent', function(event) { if (!window.formSubmitted) { window.formSubmitted = true; dataLayer.push({ 'event': 'form_submit', 'formId': event.detail.contactFormId }); console.log('Formulář byl úspěšně odeslán'); } }, { once: true });