Make names useful
Define event names, parameters and dataLayer fields once, then validate the contract against GA4 limits, naming rules and a reviewed payload. Check GA4's recommended events and naming rules before making up a new name.
Use parameters for context. Record each field's type, allowed values, source, and purpose. Never include names, emails, phone numbers, form text, credentials, or sensitive data without a specific approved need.
Generic website-to-GTM example
A product can report a confirmed lead like this:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'generate_lead',
form_id: 'contact_sales',
form_type: 'demo_request'
});This is a generic message in the site's data layer. The data layer is a shared message queue for a tag manager; it is not itself a vendor pixel and does not send data to an analytics or advertising platform. GTM needs a Custom Event trigger, variables for the fields, and a configured vendor tag to forward them. Without that mapping, only the browser message exists. Google's data-layer documentation explains the queue.
Fire the message only after success, not on every click. Each receiving platform still needs its own tag, trigger, field mapping, consent settings, and validation.
Maintain the contract
Document which component emits each event, when it fires, and what must not count. Version the contract when an event changes meaning. Test a success, a failure, and a repeat visit before release. Use the measurement plan and GA4 validation guide.
Official references
- GA4 event naming rules Checked November 10, 2026
- GA4 recommended events Checked November 10, 2026
- GA4 event parameters Checked November 10, 2026
- Google Tag Manager data layer Checked November 10, 2026
What changed
- v1.0.0Initial publication; establishes naming conventions, a parameter contract, and a dataLayer example.
- v1.1.0Clarifies that dataLayer is a generic website-to-GTM queue and documents the trigger, variable, and vendor-tag mapping required to forward it.