The WordPress plugin Contact Form 7 is quick to set up — but if you want to know which submissions actually turn into leads, you need a clean tracking setup. That’s where Google Tag Manager (GTM) comes in. It ensures your form submissions are reliably sent to Google Analytics 4 (GA4), Google Ads, or other marketing tools.
In this guide, we show you step by step:
• how to set up event tracking for Contact Form 7 in GTM,
• which DOM events you can use (e.g., wpcf7mailsent), and
• how to evaluate your data later in GA4 or as Ads conversions.
If you want to manage your marketing channels based on data, functional form tracking is essential. At WEVENTURE, we help companies build exactly these kinds of structures every day — efficiently, measurably, and at scale.
In this Article
Conversion rate optimization through clean tracking
Why Contact Form 7 tracking is important
Forms are among the most crucial conversion points on a website — especially in B2B and lead generation. If you use Contact Form 7, you’re collecting valuable contacts, but without tracking you never know where these leads actually come from.
Clean form tracking gives you the data you need for campaign management, budget decisions, and conversion optimization. With Google Tag Manager, you can centrally record form submissions and forward them to tools like Google Analytics 4 or Google Ads. This lets you see which channels truly deliver leads — and refine your marketing based on real performance data, from keyword strategy to audience targeting.
When you don’t need Google Tag Manager
In many cases, Google Tag Manager is the easiest way to manage tracking centrally — but it isn’t always necessary. If you use only a few tools or prefer not to rely on Google services, there are alternatives.
One option is to place the tracking code directly in the website — such as the GA4 snippet or a Meta Pixel. This is less flexible but can be perfectly sufficient for small websites or projects without complex tracking needs.
If you want to avoid Google entirely, platforms like Matomo are a strong alternative. Matomo is an independent analytics tool with its own tag manager that you can self-host — giving you full control over your data. Server-side tagging is another option if you want to collect tracking data independently from Google or send it to multiple tools at once.
In short: Google Tag Manager isn’t mandatory — it’s a tool.
If you prefer another infrastructure or want to keep your setup lightweight, you can still implement effective form tracking without GTM.
What you need for Contact Form 7 tracking
WordPress with an active Contact Form 7 plugin
Google Tag Manager (GTM)
Google Tag Manager is your central control hub for tracking. It lets you capture events like form submissions without having to manually edit your website’s code.
You’ll need:
an active GTM container installed on your website,
access to that container (admin or edit rights),
and a basic understanding of tags, triggers, and variables.
GTM ensures that your form submission event lands in the Data Layer and can then be forwarded to tools like GA4 or Google Ads.
Google Analytics 4 (GA4)
To see which form submissions actually occur, you’ll need a GA4 property. This is where events are collected and analyzed. For Contact Form 7 tracking, it’s helpful to set up:
a custom event (e.g., generate_lead or form_submission),
clearly defined parameters (e.g., formID, formName),
and mark this event as a conversion inside GA4.
This allows you to see exactly which forms generate leads in your reports.
Google Ads
If you run paid campaigns, you should also track form submissions as Google Ads conversions. That way, you’re not just measuring clicks but real leads.
You can do this by linking your GA4 event (e.g., generate_lead) with Google Ads and marking it as a conversion there. Your CF7 submissions will then feed directly into campaign optimization.
Testing environment & debugging
Before finalizing your setup, use GTM’s Preview/Debug mode. This allows you to see in real time whether the event fires correctly when a form is submitted.
Alternatively, GA4’s DebugView helps verify whether your event is being received properly.
Tracking setup with WEVENTURE
Preparing Contact Form 7 Tracking in Google Tag Manager
Before you can evaluate your first form event in Google Analytics 4 or Google Ads, you need to make sure Google Tag Manager (GTM) correctly detects your form submissions.
To do this, you’ll use Contact Form 7’s built-in DOM events, set up a Data Layer push, and test everything in Debug Mode.
Using Contact Form 7 DOM events in Google Tag Manager
For GTM to know when a form has been submitted, it needs a signal from Contact Form 7.
The plugin fires several DOM events during form interaction that GTM can listen for.
The most important events:
wpcf7mailsent – fires when a form is successfully submitted
wpcf7invalid – fires when inputs are invalid
wpcf7spam – fires when the spam filter triggers
wpcf7mailfailed – fires when sending fails
wpcf7submit – fires on any form submission attempt
For clean conversion tracking, wpcf7mailsent is usually enough, since it only fires on successful submissions.
Setting up an event listener for the Data Layer
In Tag Configuration, choose Custom HTML and paste the following snippet.
Set the trigger to All Pages.
<script>
document.addEventListener(‘wpcf7mailsent’, function(event) {
dataLayer.push({
‘event’: ‘wpcf7successfulsubmit’,
‘formID’: event.detail.contactFormId,
‘formName’: event.detail.contactFormName
});
}, false);
</script>
Once this tag is published, GTM will detect every successful form submission and push the event to the Data Layer — the foundation for your GA4 or Google Ads conversion tracking.
Testing the event listener in GTM (Debug Mode)
Before moving on, make sure the event fires correctly.
Activate Preview/Debug Mode in GTM and open a page with your form.
Submit the form — in the debug panel, you should see the event wpcf7successfulsubmit.
If you use multiple forms, verify that the correct formID or formName appears in the Data Layer.
If everything shows up as expected, your event listener works — and GTM will reliably detect every successful Contact Form 7 submission.
Creating Variables and Triggers for Contact Form 7
Use variables to distinguish between different forms
To send this unique ID through GTM, you’ll need a dedicated variable.
Create a Custom Variable with the type Data Layer Variable.
Give it a clear and meaningful name that reflects its purpose.
Even if you currently use only one form, we still recommend implementing the formID from the beginning — it’s minimal effort and keeps your setup scalable.
Create the trigger
Instead of triggering on All Custom Events, you can choose Some Custom Events and use your newly created variable (e.g., DataLayer – CF7formID) to track only a specific form.
Pro tip for managing multiple triggers
If you’re working with Some Custom Events, name your trigger in a way that makes it immediately clear which form it belongs to.
For example, include:
- the form name, or
- the page where it fires.
This helps keep your workspace organized — especially when tracking several forms across the site.
Event Tracking with Google Analytics 4 in Google Tag Manager
Create a GA4 event in Google Tag Manager
Go to your GTM container and create a new tag of the type “Google Analytics: GA4 Event.”
Select your existing GA4 configuration tag (e.g., GA4 – Configuration).
Under Event Name, enter a clear identifier, such as:
form_submission
In the Event Parameters section, you can send additional information, for example:
formID→ {{formID}} (variable from the data layer)formName→ {{formName}}
These parameters help you analyze different forms or pages more precisely later on.
As the trigger, select the Custom Event Trigger that detects your previously created event in the data layer — in this case, wpcf7successfulsubmit. This ensures that the GA4 event fires every time a form is successfully submitted.
Make sure your event and parameter names align with Google’s recommended event structure. Ideally, follow Google’s naming conventions and register your parameters as Custom Dimensions in GA4.
Recommended GA4 events
| Event | Trigger when a user… |
|---|---|
| ad_impression | views an ad (app only) |
| earn_virtual_currency | receives virtual currency such as coins, gems, or tokens |
| generate_lead | submits a form or request for information |
| join_group | joins a group |
| login | signs in |
| purchase | makes a purchase |
| refund | receives a refund |
| search | searches on your website or app |
| select_content | selects content on your website or app |
| share | shares content from your site or app |
| sign_up | registers for an account |
| spend_virtual_currency | spends virtual currency |
| tutorial_begin | starts an onboarding tutorial |
| tutorial_complete | completes an onboarding tutorial |
Marking the event as a conversion in GA4
Analyzing form tracking in reports
Once data begins to flow in, you’ll find your events in GA4 under
Reports → Engagement → Events.
Here you can see:
how often your form was submitted,
on which pages submissions occurred,
and which channels generated the leads.
If you pass additional parameters (e.g., form name or page path), you’ll gain deeper insights into how your forms perform — providing a strong foundation for data-driven marketing and optimized campaigns.
Conversion Tracking for Contact Form 7 in Google Ads with Google Tag Manager
Linking GA4 Events with Google Ads
To evaluate your form submissions as conversions in Google Ads, import the corresponding GA4 event:
Open in Google Ads:
Tools & Settings → Measurement → Conversions
Click New Conversion Action → Import
Select Google Analytics 4 Property → Web
Google Ads will now show all GA4 events that are marked as conversions — including your event form_submission.
Select the event and confirm the connection.
From this point on, GA4 automatically sends all successful form submissions to Google Ads. The platform uses this data to optimise bids, audiences, and overall campaign performance — based on real leads instead of just clicks.
Alternative: Direct Contact Form 7 Conversion Tag in GTM
If you prefer not to use GA4 as an intermediary, you can track conversions directly in Google Ads using GTM.
Here’s how:
Create a new Google Ads Conversion Tracking Tag in GTM.
Add your Conversion ID and Conversion Label from Google Ads.
Set the trigger to your custom event wpcf7successfulsubmit, which fires when a CF7 form is successfully submitted.
With this setup, every Contact Form 7 submission is sent directly to Google Ads as a conversion — ideal for accurate lead tracking without additional layers.
We boost your digital visibility!
With expertise and experience, our SEA specialists help your business achieve real results. Get your free consultation today!
Conclusion: Tracking Contact Form 7 successfully with Google Tag Manager
Reliable form tracking is essential for making informed marketing decisions. With Google Tag Manager (GTM), your Contact Form 7 forms become a dependable data source — whether you’re working with Google Analytics 4, Google Ads, or other tools.
Once you’ve completed the following steps, your tracking setup is fully operational:
✅ The event listener in GTM responds to wpcf7mailsent.
✅ The data layer push correctly sends formID and formName.
✅ Both values are implemented as variables inside GTM.
✅ The GA4 event generate_lead fires on successful form submissions.
✅ The event is marked as a conversion in GA4.
✅ The conversion is imported into Google Ads or tracked via a dedicated Ads tag.
✅ Live testing confirms: events fire reliably with no false triggers.
With everything in place, you can clearly see which campaigns generate real leads — and you can optimise your marketing strategies based on accurate data.
A clean GTM setup saves time, keeps your tracking organised, and lays the foundation for advanced configurations such as server-side tagging or enhanced conversions.
In short: Your Contact Form 7 form no longer just collects requests — it delivers valuable insights for your entire performance marketing strategy.
FAQs: Tracking CF7 with Google Tag Manager
How can I track Contact Form 7 with Google Tag Manager?
In Google Tag Manager, you set up an event listener that detects the wpcf7mailsent DOM event. This event is pushed into the data layer and passed on as a custom event to Google Analytics 4 or Google Ads.