How to Track Contact Form 7 Submissions ...

How to Track Contact Form 7 Submissions with Google Tag Manager (and Actually Use the Data

Dec 10, 2025

image

Stop Guessing Track Your Contact Form 7 Submissions Like a Pro (Using GTM + Event Listener)

Most marketers have no idea how many leads actually convert on their WordPress forms. They “think” the form works. They “hope” GA4 is tracking. But here’s the truth: if you’re not using an event listener, you’re missing data period.Let’s fix that.


What You’ll Learn

You’re going to learn how to track every successful Contact Form 7 submission inside Google Tag Manager (GTM) so you can send conversions to:

  • Google Analytics 4

  • Meta Pixel (CAPI)

  • Google Ads, Bing, and even Yandex Metrica

No plugins. No guesswork. Just data you can trust.


🧩 Step-by-Step: The Setup

Follow these exact steps:

Step 1: Create a new tag in GTM

  • Tag type → Custom HTML

  • Paste this exact code inside:

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

👉 This code listens for successful CF7 submissions and pushes a cf7submission event into the dataLayer.


Step 2: Create a custom event trigger

  • Go to Triggers → New

  • Trigger type → Custom Event

  • Event name → cf7submission

✅ This fires every time someone successfully submits a Contact Form 7 form.


Step 3: Create dataLayer variables

You’ll want these two:

  • formId → Returns the form’s ID

  • response → Returns all user-submitted input fields

This helps you pass form data to GA4, Meta, or any analytics tool.


Step 4: Connect to your conversion tags

Use your new custom event trigger (cf7submission) to fire:

  • GA4 Event Tag → Event name: generate_lead

  • Meta Pixel Tag → Event name: Lead

  • Google Ads Conversion Tag → Your conversion label


🧪 Step 5: Test Like a Pro

Before you publish:

  • Enable Preview Mode in GTM

  • Submit your form

  • In Tag Assistant, confirm the event name → cf7submission

  • Verify tags are firing under “Tags Fired”

  • Check data in GA4 DebugView or Meta Events Manager

If it works → publish it. If not → fix it before you waste ad spend.


Pro Tip:

Don’t stop at “submission.” Track input fields to see what kind of leads you’re getting not just how many. Example: High-quality vs. low-intent inquiries.


The Payoff

Once this is set up, you’ll know:

  • Exactly how many users completed your form

  • Which campaigns drive the real leads

  • And which platforms deliver ROI without the guesswork

That’s the difference between a marketer who spends and one who scales.


💼 Want It Done For You?

If you’d rather not wrestle with GTM, I’ll build this for you (and fix your existing broken tracking).

I set up: ✅ GA4 Enhanced & Lead Tracking ✅ Meta Pixel (CAPI) ✅ Server-side Tracking (via GTM + Stape) ✅ Google Ads & Bing Conversion Tracking

📩 DM me “CF7 Tracking” I’ll send you the full implementation checklist + setup offer.

Jobair Mahmud GA4 · GTM · Meta CAPI · Server-side Tracking #GTM #GA4 #ConversionTracking #ContactForm7 #MarketingAnalytics #ServerSideTracking

Enjoy this post?

Buy Jobair Mahmud (GTM,GA4,CAPI Expert) a coffee

More from Jobair Mahmud (GTM,GA4,CAPI Expert)