Skip to main content

Webflow Form GTM Event Listener

Track Webflow form submissions in Google Tag Manager. Capture form ID and fire GA4 events, Google Ads conversions, and Meta Pixel on Webflow form success.

webflowformsgtmga4lead-generationno-code

Event fired

formsubmit_event

Key variable

formID

Webflow Form

Overview

Webflow includes a built-in form component. This listener uses jQuery to catch form submissions and push the form's HTML id attribute and a formsubmit_event event to the dataLayer.

Event fired: formsubmit_event Variable: formID (form's HTML id attribute)

Why Use This Listener

Webflow forms submit via Webflow's own AJAX handler. GTM's built-in Form Submit trigger works unreliably with Webflow's AJAX submissions. This listener fires reliably using jQuery's .submit() event.

Common Use Cases

  • Track contact form and lead form submissions on Webflow sites
  • Fire Google Ads conversion tags on Webflow form completion
  • Distinguish between multiple Webflow forms using formID
  • Measure landing page form conversion rates

Installation

html
<!-- GTM Custom HTML Tag: Webflow Form Listener -->
<script>
$('form').submit(function(event) {
  var formID = $(this).attr('id');
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    'event': 'formsubmit_event',
    'formID': formID
  });
});
</script>

Note: Webflow includes jQuery. Fire on DOM Ready.

Data Layer Output

json
{
  "event": "formsubmit_event",
  "formID": "contact-form"
}

Trigger Configuration

Trigger Type: Custom Event Event Name: formsubmit_event

Per form:

Condition: DLV – Form ID | equals | "contact-form"

Variables to Capture

Variable NameDL KeyExample
DLV – Form IDformID"contact-form"

GA4 Mapping

GA4 EventParameterSource
generate_leadform_idDLV – Form ID
generate_leadmethod"webflow_form"

Debugging

ProblemCauseFix
Fires before successjQuery .submit() fires on clickAdd Webflow's success class check or use wf-form-success event
formID is blankForm has no id attributeAdd id to the Webflow form in designer

Webflow Alternative: Webflow dispatches a custom event you can also listen for:

javascript
document.addEventListener('wf-form-success', function(e) {
  dataLayer.push({ event: 'webflow_form_success', formID: e.target.id });
});

Best Practices

  1. Always assign HTML id attributes to Webflow forms for segmentation
  2. Test in Webflow's staging environment before going live
  3. Combine with UTM parameter capturing for full attribution

Related Listeners