Clean form tracking for FormAssembly, with no data collection of its own. The template loads a small runtime and writes the form lifecycle into the dataLayer. Current version: 2.0.0.
What it tracks
view: the form becomes visiblestart: first interaction with a fieldstep_N: step change on multi-step formssubmit: successful submissionerror: validation or submission errors- form ID and version (
formId,formVersion) - optional non-sensitive select choices as a label you define (for example
yes/nofor a callback preference), never the selected value
Features
- Works with forms that redirect and with forms the page submits via AJAX and replaces with a confirmation module
- Consent gating via OneTrust, or none when you use Google Consent Mode (recommended)
- Multi-step and modal forms
- SPA navigation without re-tagging
- Deduplication of repeat events
- No network calls of its own beyond loading the runtime, just
dataLayer.push
Install
- Import the template from the GTM Community Template Gallery, or load
template.tplmanually. - With Google Consent Mode, clear the consent groups and put the consent requirement on your GA4 tags. With OneTrust gating, set your groups; analytics usually sits on
C0002. - Trigger the tag on "Initialization - All Pages".
- Map your form IDs to names, and add the new ID whenever a form is copied or re-published.
Licence & code
Apache-2.0. Code on GitHub. The Gallery permalink follows after Google review.