Contact Form 7 is one of the most popular plugins for WordPress & the best part of this plugin is – it can easily be tracked in Google Analytics through Google Tag Manager. The best part of this plugin is you don’t need to create a thank you page for this & Google Analytics has no issues with it.
To set up the tracking, we would be required to:
- Contact Form 7 plugin installed on your WordPress
- Google Analytics Installed on your WordPress
- Google Tag Manager installed on your WordPress
STEP 1: Create a GTM tag for the Form Submission Event
Contact Form 7 Form Event submission means when you hit the form “Submit” button, an event fires which actually shows that your form has been submitted & the mail has been sent.
When someone submits the form, the Contact Form 7 plugin fires the DOM Events for several events which determine if the form has been submitted successfully or not. These DOM Events are:
- wpcf7invalid — Fires when form submission has been completed successfully, but mail hasn’t been sent because there are fields with invalid input.
- wpcf7spam — Fires when form submission has been completed successfully, but mail hasn’t been sent because a possible spam activity has been detected.
- wpcf7mailsent — Fires when form submission has been completed successfully, and mail has been sent.
- wpcf7mailfailed — Fires when form submission has been completed successfully, but it has failed in sending mail.
- wpcf7submit — Fires when form submission has been completed successfully, regardless of other incidents.
Since the wpcf7mailsent is that DOM Event which fires on form submission & mail sent successfully. We will create tags & triggers for this.
To create this tag:
- Go to Google Tag manager
- Click Tags on the left menu bar
- Click New on the dashboard
- Name this tag wpcf7mailsent, or what you feel is convenient.
- Click on Tag Configuration & Choose Custom HTML
Now, add the following code:
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
dataLayer.push({
'event' : 'wpcf7successfulsubmit',
'CF7formID' : event.detail.contactFormId
});
}, false );
</script>
- Fire this tag to the All Pages –Page View trigger
- Save this tag

STEP 2: Create a GTM Trigger for Above Tag
- Go to Google Tag manager
- Click Triggers on the left menu bar
- Click on New &name it as per your convenience (I have used the name: Contact Form 7 Trigger)
- Click on Trigger Configuration & choose Custom Event
- Add event name wpcf7successfulsubmit
- Fire this trigger on All Custom Events
- Save this trigger

STEP 3: Create a Tag for Form Submission
- Go to Google Tag manager
- Click Tags on the left menu bar
- Click New on the dashboard
- Name this tag Contact Form Submission, or what you feel convenient
- Click on Tag Configuration & Choose Google Analytics: GA4 Event.
- Add the Event Name: Content_Form_Submission (This name will be used in Google Analytics 4 as a parameter)
- Action – successful-form-submission-mailsent
- Label – Enter Form ID, as mentioned in the Next step: 4.
- Non-Interaction Hit, choose the default value False
- Google Analytics Settings, choose you Google Analytics Settings
- Now, fire this tag on Contact Form 7 Triggerwhich we created in the previous step

STEP 4: Setting up the Conversion in Google Analytics 4
Now as the final step, you need to set a conversions for you successful form submission in Google Analytics 4.
To create the conversions, follow the below steps:
- Login to your Google Analytics account
- Navigate to Admin > View > Conversions. Click +New Conversion Event.

- once you create it, don’t forget to test it multiple times using Google Tag Manager & Google ANalytics 7 debug mode.
So, this is the procedure which you need to follow when you create a conversion for Contact Form 7 through in Google Analytics 4 using Google Tag Manager.
Hope this you find this blog helpful. If you are having any issues while setting up conversion with the above procedure, just comment below & we will help you out.
If you need any assistance in your SEO campaign, you can hire us.
Need any help or assistance on Google Analytics 4?
Contact Form 7 Conversion Tracking FAQs
If you have Contact Form 7 in Google Analytics plugin installed on your WordPress then you need to set up tags triggers using Google tag manager. This is a simple process.
Contact form 7 configuration in analytics required to google analytics event tracking which is done using Google Tag manager data layers. Once you are done with contact form 7 setup on WordPress, follow the steps mentioned in this blog to track Contact Form 7 submission.
Contact Form 7 Plugin is a free WordPress plugin to create forms with simple HTML markup.
To use Contact Form 7, you need to install it to your WordPress & start creating forms. You can simply put the forms on any page using shortcodes.
Related Articles
How to Setup Google Ads Conversion Tracking in BigCommerce (With Order Amount & Order ID)
How to Setup Enhanced Ecommerce Tracking to WooCommerce
How to Setup Ninja Forms Event Tracking with Google Tag Manager
The Use of Artificial Intelligence (AI) in SEO – All You Need To Know