Contact Form 7 Tracking Event Listener Code

<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
 window.dataLayer.push({
 "event" : "cf7submission",
 "formId" : event.detail.contactFormId,
 "response" : event.detail.inputs
 })
}); 
</script>

Thanks: Julius Fedorovicius

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top