Tool
GTM Form Tracking Template for FormAssembly
A GTM template for the full FormAssembly form lifecycle: view, start, step, submit, error, consent-gated straight into the dataLayer. Multi-step and modal forms, SPA-aware, OneTrust consent. Open source under Apache-2.0.
Clean form tracking for FormAssembly, with no data collection of its own and no US tooling. The template loads a small runtime and writes the form lifecycle, consent-gated, into the dataLayer.
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
Features
- Consent gating via OneTrust / OptanonConsent, configurable
- Multi-step and modal forms
- SPA navigation without re-tagging
- Deduplication of repeat events
- No network calls of its own, just
dataLayer.push
Install
- Import the template from the GTM Community Template Gallery, or load
template.tplmanually. - Set your consent groups. Analytics usually sits on
C0002. - Trigger the tag on "Initialization - All Pages".
Licence & code
Apache-2.0. Code on GitHub. The Gallery permalink follows after Google review.
-
Does the template collect any data of its own?
No. It only runs `dataLayer.push`, with no network calls of its own and no external endpoint. What happens to the events is up to your own GTM tags.
-
Does it work with multi-step and modal forms?
Yes. The template reports step changes as `step_N` and treats forms inside modals like regular forms, including after SPA navigation without a page reload.
-
Which consent platform is supported?
OneTrust via `OptanonConsent` is the default, and the consent groups are configurable. In most setups analytics sits on `C0002`.