Free Google Tag Manager Template for Contact Form 7

Track successful Contact Form 7 submissions as conversions using this free Google Tag Manager template

Contact Form 7 Listener

Tag Configuration

Tag Type

Contact Form 7 Listener by Converly

Community Template Gallery ยท converlyio

Listens for Contact Form 7's mail sent signal and sends contact_form_7_submitted to the dataLayer

Firing Triggers

All Pages

Page View

A lot of businesses use Google Tag Manager to send form submissions to Google Ads, Meta Ads, Google Analytics, etc. as conversions.

For that to work, Google Tag Manager first has to know a conversion took place, and with Contact Form 7 that's harder than it sounds. Contact Form 7 sends the form in the background (using AJAX) and shows its thank you message without a page reload, which means Google Tag Manager's built-in form submission trigger doesn't work.

This free GTM template solves that. Install it from Google's Community Template Gallery and it will send a contact_form_7_submitted event for each successful Contact Form 7 form submission, ready for your conversion tags to fire from.

How to Use the Template

There are 3 parts to getting this working. You install the template, build a Trigger in Google Tag Manager, and then attach your conversion tags to it. Once that's done, every Contact Form 7 submission on your site will be sent as a conversion to Google Ads, Meta Ads, Google Analytics, or whatever other platform you rely on.

1

Install It

Step one is getting the template out of Google's Community Template Gallery and into your container, set to load everywhere on your site.

  1. 1

    In your GTM container, go into Tags and press New. That creates a new, empty tag in your account. Then click the Tag Configuration area to open the list of available tag types.

    A blank new tag in Google Tag Manager, with the Tag Configuration panel waiting for a tag type
  2. 2

    In the list that appears, click the Discover more tag types in the Community Template Gallery. Once in the gallery, do a search for "Contact Form 7".

    The list of tag types, with the Community Template Gallery link shown first
  3. 3

    Converly is the publisher of Contact Form 7 Listener, so pick that one. Then press Add to workspace, and Add again in the popup.

    Converly's Contact Form 7 Listener in the Community Template Gallery, with the Add to workspace button
  4. 4

    Under Triggering choose All Pages, give the tag a clear name (for example Contact Form 7 Listener) and hit Save. The tag now loads on every page on your site and listens for successful Contact Form 7 form submissions. Whenever one is detected, it pushes an event called contact_form_7_submitted into the dataLayer.

    The Contact Form 7 Listener tag set to fire on All Pages under Triggering
2

Create the Trigger

With the listener running, the second step is to create a Trigger. Its job is to detect the contact_form_7_submitted event when it lands in the dataLayer, and then fire your Google Ads, Google Analytics and Meta Ads conversion tags from there.

To build this out, click Triggers in the left menu, then New, and copy the settings in the screenshot below.

Exact Settings

Trigger Type
Custom Event
Event Name
contact_form_7_submitted
Name It
CE - Contact Form 7 Submitted

The CE - Contact Form 7 Submitted Custom Event trigger with its settings filled in
3

Connect Your Tags

Finally, each platform you want to send conversions to (Google Ads, Google Analytics, Meta Ads, etc) needs its own tag, set to fire on the Trigger you've just made. Here are step by step instructions for 3 of the most common destinations:

Example 1: Google Analytics

Pick Google Analytics: GA4 Event as the tag type. Enter your Measurement ID (you'll find this in the Admin section of your Google Analytics account) and an event name (something like generate_lead is a sensible choice). Finally, in the Triggering box, pick your Trigger from step 2. From here on out, a successful Contact Form 7 form submission anywhere on your website shows up in GA4 as an event.

A GA4 Event tag sending generate_lead when CE - Contact Form 7 Submitted fires

Example 2: Google Ads

For Google Ads, make one more Tag and set its type to Google Ads Conversion Tracking. You need to enter the Conversion ID and Conversion Label of the conversion action you want to send to (you'll find these in the Goals section of your Google Ads account). Finally, select the Trigger you created in step 2 as the trigger for this conversion tag. Once that's set up, every Contact Form 7 form submission will be sent to Google Ads as a conversion.

A Google Ads Conversion Tracking tag that fires on CE - Contact Form 7 Submitted

Example 3: Meta Ads

GTM has no built-in Meta tag, so you can use a Meta Pixel template from the community gallery, or a Custom HTML tag of your own that fires Meta's standard Lead event. Finally, make CE - Contact Form 7 Submitted (your Trigger from step 2) its firing trigger. Each completed Contact Form 7 form will then be recorded as a conversion event in Meta Ads.

A Custom HTML tag sending Meta's Lead event whenever CE - Contact Form 7 Submitted fires
4

Test in Preview Mode

The final step is to test everything thoroughly before it goes live. Click Preview in Google Tag Manager to open your website in the GTM preview mode, browse to one of your pages that has a Contact Form 7 form, and submit the form once. Tag Assistant should then show you:

  • A single contact_form_7_submitted event in the timeline down the left for each message sent.
  • Your conversion tags under Tags Fired once you click on that event.
  • Your Contact Form 7 form's number against form_id, on the Data Layer tab.

Everything as expected? Press Submit, give this new version a name, and click Publish to put this new version of your container live on the site.

Tag Assistant after sending a test message, with the event selected and its fired tags showing

What It Sends

Here's what the Contact Form 7 GTM Template adds to the dataLayer every time a Contact Form 7 form is successfully submitted on your website:

window.dataLayer.push({
  "event": "contact_form_7_submitted",
  "form_id": "42"
});
KeyTypeWhat It Is
eventstringAn event in the dataLayer that always has the same name (contact_form_7_submitted). This is what your GTM Trigger listens for.
form_idstringThe ID of the Contact Form 7 form that was submitted. You can use it to fire conversion tags when certain forms are submitted, like your Request a Quote form but not your Careers form. It's the number after post= in the address bar when you edit the form in WordPress.

Permissions & Privacy

Why Does Google Tag Manager Show a Warning?

When you look at a template in Google's gallery, it lists the permissions that template needs. Ours fetches code from Converly's servers, so expect a red "Injects scripts" warning on its listing, similar to this:

  • Injects scriptshttps://gtm-templates.converly.io/contact-form-7-listener.js

    Pulls in the Contact Form 7 detection script, hosted by Converly

Why This Is Actually The Best Approach

  • Secure We've locked the template to a single address, gtm-templates.converly.io. It can't load anything from any other domain, which means only Converly's own script is able to run.
  • Automatic Updates Behind the template sits the Contact Form 7 detection code that Converly built and regularly checks against real Contact Form 7 forms. If Contact Form 7 ever changes the way its forms behave, we fix that one script and your site starts using the fix right away.

Compatibility

Under the hood, this listener shares its core code with the one Converly uses to detect Contact Form 7 submissions for its own customers, so it has been put through thorough testing.

SetupStatusNote
Standard form with an on-page messageWorksOne event, sent once Contact Form 7 confirms the email went out.
Submissions Contact Form 7 rejectsWorksWhen Contact Form 7 returns a form with errors (a blank required field, for example), no event is sent.
Fixing errors and sending againWorksOnce the visitor fixes the errors and the form is accepted, one event is sent.
Double clicks on SendWorksContact Form 7 itself may save two messages, yet the listener only sends one event.
Forms that reload the page (non-AJAX mode)WorksOne event, sent once Contact Form 7 confirms the email went out.
Redirect after submitWorksOne event, sent once Contact Form 7 confirms the email went out.
Forms in a popupWorksOne event, sent once Contact Form 7 confirms the email went out.
Two forms on one pageWorksOne event, sent once Contact Form 7 confirms the email went out.
Spam protection and honeypotsWorksOnly sends an event once the form submission clears spam checks.

Tested with Contact Form 7 6.1.6, WordPress 7.0.7, Chromium 145.0.7632.6.

Troubleshooting & FAQ

Open Preview and check that the listener tag fired when the page loaded. If it didn't, its trigger is probably the custom event rather than All Pages.

Next, watch what happens when you send the form. If the whole page reloads instead of Contact Form 7 showing its message in place, the form is running in Contact Form 7's older non-AJAX mode. That mode gives no success signal, so the event can't fire.

Contact Form 7 also only confirms a submission once its notification email has gone out. If your site has trouble sending email, Contact Form 7 reports the submission as failed and no event fires. Ad blockers can stop GTM loading too, so test in a clean browser window.

Changelog

VersionDateChanges
v1.0.02 Nov 2026Launch version.

As we improve the detection script, the changes load on your site without any action from you, and each one gets logged on this page.

Where This Template Falls Short

At its core, this template just tells Google Tag Manager a Contact Form 7 form was submitted. That's useful, but it leaves several gaps:

Gets Blocked By Ad Blockers and Browser Settings

Some visitors run ad blockers, and some browsers ship with strict privacy settings. Both can prevent Google Tag Manager from loading when a visitor lands on your site, and if it doesn't load, that visitor's form submissions are never tracked.

Doesn't Capture Lead Details

Google, Meta and ChatGPT all match conversions to real people using the lead's name, email and phone, and they want you to send those details with each conversion. This template sends the fact that a form was submitted; it doesn't capture and send those details.

Doesn't Capture Click IDs

When someone clicks a Google or Meta ad, the platform adds a Click ID to the link. Sending that ID back with the conversion lets the platform tie it to the exact click that produced it. This template doesn't pick up Click IDs.

Can Break Without Warning

You won't find a conversion log in Google Tag Manager, and it never sends email alerts when things break. If something goes wrong, you have no way of knowing (until you see 0 conversions in your ad platforms weeks later).

The Proper Way to Send Conversions to Google Ads, Meta Ads & More

Converly is a conversion tracking tool built specifically for this. Whenever someone submits a Contact Form 7 form on your website, it sends the conversion to Google Ads, Meta Ads, ChatGPT Ads, etc for you.

A Converly Conversion Flow sending Contact Form 7 conversions on to Google Ads and Meta Ads

Easy to Set Up

Setting up Converly is as simple as picking a trigger (in this case, a Contact Form 7 submission) and the actions that follow it (for example, a Google Ads conversion). There's no code to write and no complex configuration.

Sends Data Server-Side

Rather than relying on the visitor's browser, Converly delivers conversions from its own servers straight to the ad platform's servers. This means that ad blockers and browser privacy restrictions can't get in the way.

Sends More Data

Alongside each conversion, Converly passes the lead's name, email and phone, plus their Click ID, IP address and user agent. Ad platforms need these to connect a conversion with a real person and the ad that brought them in (otherwise conversions don't get counted).

Conversion Log & Alerts

Each lead appears in Converly's conversion log, showing the data that was captured, what was passed to every ad platform, and whether that platform accepted it. A failed delivery triggers an email to you immediately.

100+ Tools, 20+ Destinations

Converly works with over 100 form, booking and chat tools, and it can deliver conversions to more than 20 ad platforms and analytics tools.

Free Support From Experts

Our team has spent more than 20 years working in tracking and analytics, and you can ask them for help at no cost. Google Tag Manager has no support team to turn to.

This Template vs Converly

GTM TemplateConverly
Detects Contact Form 7 submissionsYesYes
Conversions delivered byThe visitor's web browserConverly's servers
Name, email & phoneNot capturedIncluded with each one
Click IDs, IP & user agentNot capturedIncluded with each one
Alerts when it stops workingNot PossibleEmail alerts and a full log
SupportNoneOur team, at no cost

Start Your Free Trial

Give the ad platforms every Contact Form 7 conversion along with the details they match on. Converly is free for 14 days, and you won't need any code or tricky configuration.

No credit card required

About the author

Aaron Beashel
Aaron Beashel

Aaron is the founder of Converly. With over 15 years of experience in digital marketing and SaaS, he's passionate about helping businesses track and optimise their ad conversions.

Start your free trial

Easily send conversions to your ad platforms and analytics tools.
No code required.