Skip to content

Instantly share code, notes, and snippets.

@adhummer
Created December 29, 2019 16:59
Show Gist options
  • Save adhummer/f33e23d3f5a9264883cb94c96971e85d to your computer and use it in GitHub Desktop.
Save adhummer/f33e23d3f5a9264883cb94c96971e85d to your computer and use it in GitHub Desktop.
Google Tag Manager / Wordpress Contact 7 - Listener Tag for GTM
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
window.dataLayer.push({
"event" : "cf7submission",
"formId" : event.detail.contactFormId,
"response" : event.detail.inputs
})
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment