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.
Event fired
formsubmit_eventKey variable
formIDWebflow 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
<!-- 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
{
"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 Name | DL Key | Example |
|---|---|---|
| DLV – Form ID | formID | "contact-form" |
GA4 Mapping
| GA4 Event | Parameter | Source |
|---|---|---|
generate_lead | form_id | DLV – Form ID |
generate_lead | method | "webflow_form" |
Debugging
| Problem | Cause | Fix |
|---|---|---|
| Fires before success | jQuery .submit() fires on click | Add Webflow's success class check or use wf-form-success event |
formID is blank | Form has no id attribute | Add id to the Webflow form in designer |
Webflow Alternative: Webflow dispatches a custom event you can also listen for:
javascriptdocument.addEventListener('wf-form-success', function(e) { dataLayer.push({ event: 'webflow_form_success', formID: e.target.id }); });
Best Practices
- Always assign HTML
idattributes to Webflow forms for segmentation - Test in Webflow's staging environment before going live
- Combine with UTM parameter capturing for full attribution