FreeGoogle Tag Manager recipes

Track Contact Form 7 Submissions in Google Tag Manager with this Free GTM Recipe

A free, tested Google Tag Manager recipe that captures Contact Form 7 submissions and turns them into a trigger you can use to fire conversions to Google Ads, Google Analytics and more.

Aaron Beashel
Aaron BeashelUpdated July 20267 min read
The Contact Form 7 recipe tag inside Google Tag Manager

Google Tag Manager is a common way to send conversions to Google Ads, Google Analytics, etc after someone submits a Contact Form 7 form on their website. The trouble is, it's fiddlier than it looks. Contact Form 7 submits over AJAX, so Google Tag Manager's built-in form submission trigger never sees it, which leaves you writing custom code to catch the submission, push an event to the dataLayer, and wire a trigger on top of that.,And unless you can write code or know Google Tag Manager inside out, that's a real slog. The good news is there's an easier way. Just import this Contact Form 7 Conversion Tracking Recipe into your Google Tag Manager account and everything you need for basic conversion tracking is already in place.

What Is a Google Tag Manager Recipe?

A recipe is a pre-built bundle of Google Tag Manager assets (tags, triggers, etc) that you import in one go. Rather than writing your own code to catch form submissions, push events to the dataLayer, and build out variables and triggers, you just upload the pre-built assets into your account. It's a great way to a tested, working Google Tag Manager setup without doing the manual work yourself.

Get the free recipe!

Get the file and upload it into Google Tag Manager. It has everything you need to track Contact Form 7 submissions inside.

Built from Converly's own Contact Form 7 detection code

What This Recipe Includes

This recipe listens for Contact Form 7 submissions, sends a 'Form Submitted' event to Google Tag Manager, and gives you a Trigger for sending conversions to Google Analytics, Google Ads, etc.,It has three parts:

Custom HTML Tag

The code watches for a successful Contact Form 7 submission and pushes a 'contact_form_7_submitted' event to the dataLayer.

Variable

A Data Layer Variable that reads the ID of the form that was submitted, ready to use in any tag.

Trigger

A Trigger that fires on the 'contact_form_7_submitted' event, ready to use as the Trigger for any of your conversion Tags (i.e. Google Analytics 4 event, Google Ads Conversion, etc).

Why It's the Best Recipe Out There

It comes from the same detection code that powers our own conversion tracking product, Converly, but adapted to run inside Google Tag Manager.

Only listens for Contact Form 7's dedicated success event, which fires after the server confirms the email was actually sent, so a submission that fails validation or gets spam filtered is never counted as a conversion.,Handles a form ID quirk in current Contact Form 7 releases (the ID moved to the wrapping element) that leaves naive scripts coming back empty, so it still captures the right form ID., A genuine submission fires the event exactly once, and a rejected submission fires nothing.,Has been tested extensively and used to detect thousands of Contact Form 7 submissions by our customers.

How to Use the Contact Form 7 GTM Recipe

1

Install the Recipe

Download the recipe from the form above, then import it into your Google Tag Manager container. Inside GTM, open Admin, pick Import Container, choose the file you saved, and select Merge so nothing already in your container gets overwritten. The tag, variable and trigger are set up for you automatically.

Importing the recipe container in Google Tag Manager
2

Configure Your Tags

Once the recipe is installed, you'll get a Trigger you can use to fire your conversion tags. Here are two common examples.

Example 1: Google Analytics

In Google Tag Manager, open Tags and click New. Choose "Google Analytics: GA4 Event" as the tag type, enter your GA4 configuration tag (or enter your Measurement ID), and name the event something like generate_lead. Set its firing trigger to the recipe's trigger (which is named CE - Contact Form 7 Submitted), and click save. Every Contact Form 7 submission now sends that event to Google Analytics.

A GA4 event tag using the recipe's trigger

Example 2: Google Ads

First, set up a conversion action in your Google Ads account (under Goals, then Conversions) to get a Conversion ID and Conversion Label. Back in Google Tag Manager, add a new "Google Ads Conversion Tracking" tag, drop in those two values, and set its firing trigger to 'CE - Contact Form 7 Submitted'. Save and publish, and each Contact Form 7 submission will send a conversion to Google Ads.

A Google Ads conversion tag using the recipe's trigger

What This Enables You to Do (and What It Doesn't)

Whenever a successful Contact Form 7 submission is detected, this recipe fires an event in Google Tag Manager that you can trigger conversions from. But there are a few things it can't do:

What it does

Sends an Event to GTM

Detects successful Contact Form 7 submissions and pushes an event called 'contact_form_7_submitted' into your dataLayer on its own.

Tells You Which Form Fired

Captures the ID of the form that was submitted and sends it along with the 'contact_form_7_submitted' event, so a site with several forms can fire different tags for each one.

Creates a Trigger in GTM

Gives you a 'Trigger' in Google Tag Manager you can attach to any of your conversion tags.

What it doesn't do

Doesn't send the conversion server-side

Google Tag Manager runs entirely in the visitor's browser, so an ad blocker can block the tag from loading and browser privacy settings can shrink your tracking window to as little as a day.

Doesn't send Click IDs or Identifiers

It doesn't collect the Google click ID, Facebook click ID, Meta pixel cookies, IP address or user agent. These are the details ad platforms need for Enhanced Conversions (Google) or a solid Event Match Quality score (Meta).

Doesn't send personal details

The script fires an event and nothing more. It doesn't pass the lead's name, email or phone number, which Google and Meta both need for enhanced conversions and a high match score.

Doesn't log conversions or send notifications

You can check it with Tag Assistant when you set it up, but after that there's nothing to tell you if it breaks (you'll just later notice that conversions have stopped appearing in your ad accounts)

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

If you're only sending events to Google Analytics, which takes no personal information or IP addresses, this recipe has you covered. But the moment you want a solid Event Match Quality (EMQ) score in Meta or Enhanced Conversions in Google, the data has to go server-side, together with the lead's name and email. That's where Converly comes in.

A Converly workflow sending Contact Form 7 conversions to ad platforms

So here's what makes Converly the best way to send conversions to Google Ads, Meta Ads, Microsoft Ads, LinkedIn Ads, etc.

Easy to set up

Converly gives you a simple drag-and-drop builder for creating a Conversion Flow. Choose a trigger (a Contact Form 7 submission) and then choose your actions (like sending a conversion to Google Ads). No custom code, no fiddly configuration.

Sends Data Server-Side

Converly delivers conversions straight to the ad servers of Google, Meta and the rest, so ad blockers and privacy restrictions have nothing to block.

Sends More Data

It collects the lead's name, email and phone alongside the Google and Facebook click IDs, IP address and user agent, and sends the lot with every conversion. That enables Enhanced Conversions in Google Ads and earns you an Event Match Quality (EMQ) score of 9 or 10 in Meta.

Full Conversion Log & Email Notifications

See every conversion, what was captured, what went to each platform and whether it arrived. Set up email alerts to let you know if anything goes wrong so you'll be the first to know if your conversion tracking breaks.

Supports Multiple Tools & Destinations

Converly listens for submissions from 80+ form, scheduling and chat tools and delivers to 20+ destinations including Google Ads, Meta, LinkedIn, Microsoft and TikTok. So whenever you add a new tool or start advertising on a new platform, it's only a few clicks to get covnersiont racking set up.

Provides Free Support

Our team has 20 years of experience in conversion tracking and analytics and is ready to help whenever you need it. With tools like Google Tag Manager, you're on your own.

Start Your Free Trial

Start a 14-day free trial and track your conversions the proper way. No code, no complicated configuration.

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.