Multi-platform

Universal GTM Form Tracker: One Tag for Nine Form Platforms

One GTM tag that detects the form platform on the page and tracks real confirmations for Gravity Forms, Elementor Pro, Contact Form 7, WPForms, GoHighLevel, Unbounce, SwipePages, Kartra and Squarespace.
9 platforms, One tag, CAPI dedupe, Container import

Free and MIT licensed. Paste it into a GTM Custom HTML tag. No plugin or code change on the site.

At a glance

Version

3.3.0

Updated

October 28, 2026

Success event

{platform}_form_success

Failure event

{platform}_form_failed

Detection

Per-platform success signal

Redirects

Yes: postback pages, thank-you recall, pagehide

Enhanced Conversions

Yes: email, phone, name, address, optional SHA-256

Dependencies

None

Tag size

82.8 KB (+ container JSON)

License

MIT

What lands in your dataLayer

One clean event per real lead

Every success carries an event ID for Meta deduplication, the detection method that fired, and normalized contact fields you can map straight into Enhanced Conversions. Keep the PII keys out of GA4.

				
					{
  event: "gf_form_success",
  ec_event_id: "uuid-v4",
  ec_detection_method: "confirmation_event",
  ec_tracker_version: "3.3.0",
  ec_name: "Jane Doe",
  ec_first_name: "Jane",
  ec_last_name: "Doe",
  ec_email: "jane@example.com",
  ec_phone: "+15551234567",
  form_url: "https://example.com/contact",
  form_cta: "Submit",
  form_platform: "gravityforms",
  form_position: "top",
  form_index: 1,
  form_id: "gform_3",
  ec_submit_attempt: 1,
  ec_time_to_submit_s: 42,
  ec_fast_submit: false,
  ec_first_source: "google",
  ec_first_medium: "cpc",
  ec_click_id: "Cj0K...",
  ec_click_id_type: "gclid"
}
				
			

One tag for nine platforms

If a client runs more than one form platform, or you manage many containers, install one tag instead of one listener per platform. The Universal tracker detects which platforms are on the page and uses each one’s own success signal.

Platform Success signal Event prefix
SwipePages amp-form-submit-success class swipe_form
Gravity Forms gform_confirmation_loaded, confirmation wrapper, postback pages gf_form
Unbounce Confirmation render after submit, HTML5 invalid for failures unbounce_form
Elementor Pro submit_success + .elementor-message-success elementor_form
GoHighLevel (inline and iframe) Confirmation render, verified postMessage from the iframe ghl_form
Kartra Confirmation render, error border class for failures kartra_form
WPForms wpformsAjaxSubmitSuccess, confirmation container, postback pages wpforms_form
Squarespace 2xx from /api/form/ + submission message squarespace_form
Contact Form 7 wpcf7mailsent + data-status="sent" cf7_form

One GTM trigger catches every success event:

^(swipe|gf|unbounce|elementor|ghl|kartra|wpforms|squarespace|cf7)_form_success$

What v3.3.0 adds

  • Five new platforms: Elementor Pro, Kartra, WPForms, Squarespace and Contact Form 7.
  • ec_event_id on every event for Meta CAPI deduplication, and ec_detection_method so you can see how each lead was detected.
  • A 5-minute dedupe ledger, optional SHA-256 hashing, and first and last touch attribution with click IDs.
  • Enhanced Conversions keys for first and last name, company and address, and E.164 phone normalization.
  • A consent queue: events raised while analytics consent is denied are replayed when it is granted.
  • strictSuccess to drop inferred successes, plus failure diagnostics and a status() debug API.
  • No existing event name or key changed, so v2.0.0 triggers keep working.

Universal or a single-platform listener?

Both run the same v3 core, so hashing, dedupe and event IDs are the same. Use a single-platform listener when the site runs one form platform: it is roughly half the size. Use the Universal tag when one site mixes platforms or you want one install across many containers. Never run the Universal tag and a single-platform listener for the same platform on one page, or each lead is counted twice.

Install it

Option A: import the GTM container (no code)

  1. Download the container JSON above.
  2. In GTM go to Admin, Import Container, choose Merge and Rename conflicting tags.
  3. Open the variable Const - GA4 Measurement ID and replace the placeholder with your own ID.
  4. Preview, submit a test form, confirm a *_form_success event, then publish.

Option B: paste the tag yourself

  1. Download the GTM tag above. It includes the <script> wrapper and a production config block, and fits under GTM’s Custom HTML size limit.
  2. Create a Custom HTML tag, paste it in and trigger it on All Pages (or Consent Initialization if you use a CMP).
  3. Create a Custom Event trigger with the regex above (regex matching on) and attach your GA4, Google Ads, Meta or server-side GTM tags.

Configuration and consent

Key Default Notes
debug false Console logs. Testing only
hashPii false Adds ec_email_sha256 and ec_phone_sha256 (needs HTTPS)
rawFields false Leaves ec_raw_fields out of the payload
dedupe true Suppresses a repeat success for the same form and person within 5 minutes
strictSuccess false true drops inferred successes (pagehide, form_removed)
defaultCountryCode '1' Phone E.164 fallback. A country field on the form takes priority
countryCodeField '' Exact field name that holds an ISO2 or dial code
redactFields [] Extra field names to strip. Password, card, SSN and IBAN fields are always stripped
platforms all Limit detection, e.g. ['cf7','gravityforms']

The tracker auto-detects Google Consent Mode v2, OneTrust and Cookiebot. With analytics consent denied, nothing fires and nothing is stored. With PII consent denied, events fire without contact data. Any other CMP can be wired in with window.EC_FORM_CONSENT_CHECK.

Keep PII out of GA4

The payload can include ec_name, ec_email, ec_phone and address keys. GA4’s terms prohibit PII in event parameters, so use them only for Enhanced Conversions, Meta CAPI or first-party CRM workflows, and send form_id, form_platform and ec_detection_method to GA4.

Test it before you publish

  • Submit a valid form on each platform you use. Expect one success event per submit.
  • Submit with a required field empty. Expect the platform’s _form_failed event.
  • Run window._ecFormTracker.status() to see detected platforms, attached forms, consent state and the last event.

Known limitations

  • The GoHighLevel iframe message format is reverse-engineered. If GoHighLevel changes it, that path stops firing until updated.
  • Inferred successes (pagehide, form_removed) are on by default. Set strictSuccess: true to drop them.
  • Platforms change their markup. Test on the live page before publishing.
  • Bot or spam submissions that pass the platform’s own validation still count as success.

Changelog

  • 3.3.0: nine platforms, ec_event_id, detection methods, dedupe, hashing, attribution, consent replay, expanded Enhanced Conversions keys and strictSuccess. The container import ships the v3.3.0 tag.
  • 2.0.0: SwipePages, Gravity Forms, GoHighLevel and Unbounce, with consent gate, PII redaction and failure tracking.

On this page

Want it installed and verified?

We install the listener, wire GA4, Google Ads Enhanced Conversions and Meta CAPI, and check the numbers against your CRM.

Keep going

More GTM form listeners

Embedded form builders

Jotform Listener for GTM: Track Redirecting Forms Without Thank-You Page Triggers

Tracks Jotform submissions in GTM even when the form redirects to a thank-you page, and never counts a refresh, back button or direct visit to that page.
Redirect-safe · EC-ready (source embeds) · CAPI dedupe · 88 tests
v3.3.0-jotform.1
WordPress forms

Gravity Forms Listener for GTM: GA4, Enhanced Conversions and Meta CAPI

Tracks real Gravity Forms submissions in GTM, including AJAX confirmations, postback pages and same-domain thank-you redirects, with hashed email and phone for Enhanced Conversions.
EC-ready · Redirect-safe · CAPI dedupe · Tracks failures
WordPress forms

Elementor Pro Form Listener for GTM: GA4, Enhanced Conversions and Meta CAPI

Tracks successful Elementor Pro form submissions, inline messages and redirects in GTM, with failure events and Enhanced Conversions data built in.
EC-ready · Redirect-safe · CAPI dedupe · Tracks failures

When the numbers still do not match

Your form fires. Does the conversion match the CRM?

A listener fixes detection. If Google Ads, Meta and GA4 still disagree with your actual leads, the problem is usually elsewhere in the container, the consent setup or the CRM hand-off.