SaTracking
Events and dataNEWBeginner

Name events and parameters consistently

Define a practical convention so product events are clear, comparable, and easier to maintain in GA4 and GTM.

Download for AI (.txt)

Measurement topic illustration · SaTracking

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:

js
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

EDITORIAL HISTORY

What changed

  1. v1.0.0
    Initial publication; establishes naming conventions, a parameter contract, and a dataLayer example.
  2. v1.1.0
    Clarifies that dataLayer is a generic website-to-GTM queue and documents the trigger, variable, and vendor-tag mapping required to forward it.
MEASUREMENT SUPPORT

Need a hand with your tracking?

Nicolas Salazar works with teams on analytics, tracking plans, data quality, consent, and implementation.