Google Tag Manager
Freeform's Google Tag Manager (GTM) integration pushes an event to the website's data layer after a completed, successful AJAX submission. You can map selected form fields to event parameters without writing JavaScript.
Freeform pushes the data-layer event; a tag and trigger configured in GTM send it to Google Analytics or another destination.
Setup Instructions
Enable Google Tag Manager inside Freeform
- Visit Freeform → Integrations and select Google Tag Manager.
- Turn on Enabled by default if you want the integration enabled on forms by default. You can also enable it only on individual forms.
- Leave Container ID blank if GTM is already installed on your website. Otherwise, enter your container ID, such as
GTM-XXXXXX, to have Freeform load it. Freeform avoids loading the same container again when it is already present. - Set a default Event Name, if desired, and save the integration.
Use your website's existing tracking installation; you do not need to install another Google tag.
Configure the Form
- Open your form in the builder and enable AJAX submissions.
- Visit Integrations → Google Tag Manager and turn on Enabled.
- Set Event Name to the event you want GTM to receive, such as
generate_lead. If left empty, Freeform usesform-submission.
The main integration supplies defaults for the container and event name. Field mappings are configured separately for each form because each form has its own fields.
Map Event ParametersNew in 5.17.3+
Under Event Parameters, click Add parameter, enter a parameter name, and select the form field whose submitted value should be included. Repeat for additional parameters, then save the form.

form_name is included automatically using the form's configured name; you do not need to add a mapping for it. Mappings stay connected when a field handle changes.
The field selector supports Dropdown, Multiple Select, Radios, Checkbox, Checkboxes, Cards, Opinion Scale, Rating, Range, Number, and Hidden fields. Multiple selections are joined with a comma and space. String values are limited to 100 characters, and missing or unsupported fields are omitted.
You can add up to 24 custom parameters. Names must be unique, start with a letter, contain only letters, numbers, or underscores, and be no longer than 40 characters. Reserved names such as form_name, event, form, and submission, and the prefixes google_, ga_, firebase_, and gtm_, cannot be used.
Only map non-personal values. Never send names, email addresses, phone numbers, property addresses, message contents, or other personal information to Google. Freeform excludes free-text and contact fields from the selector, but option values and hidden fields can still contain personal data. Check the values of every field you map.
Freeform uses the submitted server-side values, including values from earlier pages of a multi-page form. It does not read form controls after they have been reset.
Configure Google Tag Manager
For a GA4 event such as generate_lead:
- Create a Custom Event trigger matching the Freeform Event Name.
- Create Data Layer Variables for
form_nameand your mapped parameter names, such asinsurance_typeandoffice_location. - Create a Google Analytics: GA4 Event tag using your existing Google tag's GA4 destination. Set its event name and attach the Custom Event trigger.
- In the tag's event parameters, connect each parameter name to its matching Data Layer Variable.
See Google's guides to data-layer events and triggers and GA4 Event tags for the GTM configuration steps. Test the workspace before publishing its changes.
This integration pushes to GTM's dataLayer; it does not call gtag('event', ...) directly. A site with only a direct Google tag installation needs its own event listener or a GTM setup to send these events to GA4.
Test Successful and Failed Submissions
Open GTM Preview and connect to your form using Tag Assistant.
- Submit a valid form. Confirm exactly one matching data-layer event and one firing of your GA4 Event tag, with the expected parameter values.
- Submit with a validation error. Confirm that no completion event or GA4 tag fires.
- For multi-page forms, confirm that moving between pages does not fire the event; only the completed submission should fire it.
You can also inspect GA4 collection requests in the browser's Network panel or use GA4 DebugView when debugging is enabled. Check for existing Submit-click listeners or other tracking scripts that could send additional events.
Submission Timing and Event DataImproved in 5.17.3+
Freeform emits the event only after the server confirms a completed, successful AJAX submission. Validation errors, failed requests, intermediate pages, pending actions, duplicate submissions, and submissions identified as spam do not produce the completion event.
Repeated notifications for the same submission are deduplicated within the page, including when legacy and current Freeform tracking handlers are both present. This does not deduplicate events sent independently by other scripts or tags.
For example, the mappings above produce an object like this in window.dataLayer:
{
"event": "generate_lead",
"form": {
"handle": "getAQuote",
"finished": true,
"multipage": false,
"success": true
},
"submission": { "id": 123 },
"form_name": "Get a Quote",
"insurance_type": "Home",
"office_location": "Sidney"
}
The submission ID is included when available. Submission tokens are not included, and Freeform does not copy all form answers into the data layer. Previously mapped parameters that are absent from the next tracked submission are cleared with null to avoid reusing earlier values.
Customizing
For additional non-personal values, the freeform-gtm-data-layer-push JavaScript event remains available. It runs once for an eligible submission, before Freeform pushes to the data layer:
document.addEventListener('freeform-gtm-data-layer-push', function (event) {
event.payload.campaign = 'summer';
});
Use the native field mappings for submitted selections rather than reading controls that may already have been reset. Calling event.preventDefault() suppresses Freeform's data-layer push for that submission.