Free Google Tag Manager Template for WPForms

Track WPForms submissions in Google Tag Manager with this free template. It pushes wpforms_form_submitted to the dataLayer whenever a WPForms form is successfully submitted on your site.

WPForms Listener

Tag Configuration

Tag Type

WPForms Listener by Converly

Community Template Gallery ยท converlyio

Listens for successful WPForms submissions and sends wpforms_form_submitted to the dataLayer, which you can use to fire conversions to Google Ads, Google Analytics and more.

Firing Triggers

All Pages

Page View

The internet is full of articles telling you to use Google Tag Manager to send conversions to Google Ads, Meta Ads, Google Analytics, etc whenever someone fills in a form on their website.

It's not bad advice, but the tricky part is letting Google Tag Manager know a WPForms form was actually submitted. Depending on how you set it up, WPForms can submit the form with AJAX and show a message without reloading, or it can reload the page and then show a success message, or it can redirect the visitor somewhere else after the form is submitted. GTM's built-in form submission trigger can't detect any of these.

The only way to do it properly is to write custom code that listens for the various signals WPForms sends when a form is successfully submitted, and then send an event to the dataLayer (which you can then use to create a Trigger in GTM which fires your conversion tags).

If that all sounds technical and complicated, then don't worry, because this template takes care of the hard part for you. Add it from Google's Community Template Gallery and every successful WPForms form submission shows up in GTM as a wpforms_form_submitted event that you can fire your conversion tags from.

How to Use the Template

Below are the steps to add the template, build a Trigger in GTM and connect your conversion tags, so that every WPForms submission ends up as a conversion in Google Ads, Meta Ads, Google Analytics or anywhere else you need.

1

Install It

First, add the template to your container from Google's Community Template Gallery and set it to fire on every page.

  1. 1

    Head to the Tags screen in your container, click New, then click the Tag Configuration box to pick a tag type.

    A new, empty tag in Google Tag Manager with the Tag Configuration box ready to click
  2. 2

    Click Discover more tag types in the Community Template Gallery at the top of the list and search for "WPForms".

    The tag type list, with the link to the Community Template Gallery
  3. 3

    Select WPForms Listener from Converly, click Add to workspace and then Add to confirm.

    WPForms Listener by Converly in the Community Template Gallery, with the Add to workspace button
  4. 4

    Set the trigger to All Pages, name the tag something you'll recognise (like WPForms Listener) and click Save. Once this is done, the tag will run on every page of your site and listen for WPForms submissions, and push an event called wpforms_form_submitted to the dataLayer.

    The listener tag set to fire on All Pages, ready to save
2

Create the Trigger

Now create a Trigger that waits for the wpforms_form_submitted event to appear in the dataLayer.

Google doesn't let gallery templates include Triggers, so you need to create this manually. Go to Triggers, click New and enter the settings shown below.

Exact Settings

Trigger Type
Custom Event
Event Name
wpforms_form_submitted
Name It
CE - WPForms Submitted

A Custom Event trigger named CE - WPForms Submitted, ready to save
3

Connect Your Tags

The last step is to create conversion tags for each destination you want to send conversions to (Google Ads, Google Analytics, Meta Ads, etc) and set them to fire on the Trigger you just made. Here's how to set up the most common ones:

Example 1: Google Analytics

Choose the Google Analytics: GA4 Event tag type, enter your Measurement ID and give the event a name such as generate_lead. Then, under Triggering, pick the Trigger you made in step 2. Google Tag Manager will now send an event to GA4 every time someone successfully submits a WPForms form on your website.

A GA4 Event tag sending generate_lead on CE - WPForms Submitted

Example 2: Google Ads

Create a new Tag with Google Ads Conversion Tracking as the tag type. You'll need a couple of details from your Google Ads account here, so open the conversion action you want to use in Google Ads and copy its Conversion ID and Conversion Label into the tag. Then pick the Trigger you made in step 2 under Triggering. Google Ads will now receive a conversion every time someone successfully submits a WPForms form on your website.

A Google Ads Conversion Tracking tag set to fire on CE - WPForms Submitted

Example 3: Meta Ads

For Meta, either add a Meta Pixel tag from the community gallery or write a Custom HTML tag that sends the standard Lead event. Then set CE - WPForms Submitted (or whatever you called the Trigger you made in step 2) as its firing trigger, and Meta Ads will receive a conversion each time someone completes one of the WPForms forms on your site.

A Custom HTML tag sending Meta's Lead event on CE - WPForms Submitted
4

Test in Preview Mode

Before you publish, click the Preview button in Google Tag Manager, load a page that has your WPForms form on it, and send a test entry. In Tag Assistant you should see:

  • One wpforms_form_submitted event in the left timeline for each submission.
  • Your conversion tags listed under Tags Fired when that event is selected.
  • The form's number under form_id on the Data Layer tab.

If everything checks out, click Submit, give the version a name and description, and then click Publish to make it live.

Tag Assistant after a test entry, with the event selected and the tags it fired

What It Sends

Each time WPForms accepts a submission on your site, the WPForms GTM Template adds the following to the dataLayer:

window.dataLayer.push({
  "event": "wpforms_form_submitted",
  "form_id": "22"
});
KeyTypeWhat It Is
eventstringAlways the same (wpforms_form_submitted). This is the value the GTM Trigger you built above listens for.
form_idstringWhich WPForms form was submitted. It's handy if you only want conversion tags to fire for some forms (for example, your Quote Request form but not your Newsletter signup). It's the number in the form's shortcode, so [wpforms id="22"] is form 22.

Permissions & Privacy

Why Does Google Tag Manager Show a Warning?

Google's Community Gallery lists the access every template asks for. Because this tag pulls its code from Converly's servers, the listing shows a red "Injects scripts" warning, like the one below:

  • Injects scriptshttps://gtm-templates.converly.io/wpforms-listener.js

    Loads the WPForms detection script from Converly's servers only

Why This Is Actually The Best Approach

  • Secure Code can only come from gtm-templates.converly.io. No other domain is allowed, so nothing but Converly's own script can run.
  • Automatic updates. It's the same WPForms detection code Converly runs for its customers, checked regularly on live WPForms forms. When WPForms changes how its forms work, we fix the script once and every site using the template gets the fix.

Compatibility

This WPForms listener is built on the same core code as Converly's own WPForms detection, so it has been thoroughly tested and has already picked up thousands of real submissions for Converly customers.

SetupStatusNote
AJAX on, confirmation messageWorksFires a single event when the message shows, without a reload.
AJAX off, confirmation messageWorksFires once on the reloaded page, when the message appears.
AJAX off, redirect to a page on your siteWorksFires once on the page the visitor is sent to.
Rejected submissionsWorksEntries WPForms sends back with errors never fire.
Fixing errors and resubmittingWorksFires once, when the corrected entry is accepted.
Double clicksWorksOne click or two, each submission fires once.

Tested with WPForms 1.6.7, WordPress 7.0.7, Chromium 145.0.7632.6.

Troubleshooting & FAQ

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

With AJAX turned off, WPForms reloads the page and the event fires on the page that loads next, so the tag has to run there too. All Pages takes care of that. The browser also has to allow storage for the tab, which some strict privacy settings block.

An entry WPForms rejects never fires, and neither does a redirect to another website when the page reloads. Ad blockers and privacy extensions can also stop GTM loading, so test in a clean browser window.

Changelog

VersionDateChanges
v1.0.025 Oct 2026First release of the template.

Any fix to the detection script reaches your site on its own, and it's recorded here as well.

Where This Template Falls Short

All this template does is let Google Tag Manager know when a WPForms form has been submitted. That gets you started, but there are a few issues (particularly if you want to send conversions to ad platforms):

Gets Blocked By Ad Blockers and Browser Settings

Plenty of visitors use ad blockers or browsers with strict privacy settings, and either can stop Google Tag Manager from loading when the visitor lands on your website (which means any conversions from those visitors don't get tracked).

Doesn't Capture Lead Details

To match a conversion to a real person, ad platforms like Google, Meta and ChatGPT want the lead's name, email and phone. The template doesn't pass any of those on.

Doesn't Capture Click IDs

Every click from ad platforms like Google or Meta carries a Click ID, and sending it back lets the platform credit the conversion to the ad with 100% accuracy. The template does not capture and send it.

Can Break Without Warning

There's no record of conversions in Google Tag Manager and nothing emails you when they stop. So a plugin or theme update, or a simple change to the form's settings, could break your conversion tracking and you'd have no idea.

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

Converly is a conversion tracking tool built for exactly this. It picks up every WPForms submission on your site and sends the conversion to Google Ads, Meta Ads, ChatGPT Ads and more.

A Converly Conversion Flow that sends WPForms conversions to Google Ads and Meta Ads

Easy to Set Up

Pick a trigger, like a WPForms form submission, then pick where the conversion should go, like Google Ads. That's the whole setup, with no code.

Sends Data Server-Side

Conversions travel from Converly's servers to each ad platform's servers, so nothing in the visitor's browser (like ad blockers) can stop them.

Sends More Data

Every conversion carries the lead's name, email and phone, plus their Click ID, IP address and user agent. That lets ad platforms link the conversion back to a real person and the original ad they clicked, making your reporting far more accurate (if it can't match the conversion to an ad, the conversion just doesn't get counted).

Conversion Log & Alerts

Every lead gets an entry in Converly's conversion log, showing the details that were captured, what each ad platform received, and whether it accepted the conversion. If a delivery fails, you hear about it by email right away.

100+ Tools, 20+ Destinations

More than 100 form, booking and chat tools work with Converly, and conversions can go out to over 20 ad and analytics platforms.

Free Support From Experts

Any questions go to a team with over 20 years in tracking and analytics, and the help is free. Google doesn't provide any support for Tag Manager.

This Template vs Converly

GTM TemplateConverly
Detects WPForms submissionsYesYes
Sent to ad platforms byThe browser on the visitor's deviceConverly, server to server
Lead's contact detailsNot capturedSent every time
Click IDs, IP and user agentNot capturedSent every time
Spotting problemsNot PossibleConversion log and email alerts
SupportNo one to askOur team helps for free

Start Your Free Trial

Get every WPForms conversion to your ad platforms with the lead details they use for matching. Try Converly free for 14 days, no code required.

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.