How do I track Contact Form 7 form submissions with Google Tag Manager?

If your site is under WordPress and you use Contact Form 7 contact forms, then you need to track conversions from CF7 forms (contact form 7).

Create the CF7 shipment monitoring tag

Because of the specificity of CF7, you will have to create a tag HTML in GTM, whose code is shown below:

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

The function of this tag is to monitor the submission events of CF7 forms of the “cf7submission” type. Connect this tag to “all pages.”

GTM-CF7-listener

Create the variable and trigger related to CF7 form submission

Create a “Custom Event” trigger (at the bottom of the list) and use “cf7submission” as the name of the event (without quotes).

Finally, link the Appvizer conversion tag with this trigger.

GTM-déclencheur-CF7

The implementation of GTM conversion tracking on CF7 forms is complete, it remains to be tested with the GTM preview and debug console.

Launch the GTM preview and debugging console then go to the page, fill out the form and validate. You need to see the Appvizer tag and the associated trigger are launched.