A form submission appears in the data layer, but no lead appears in GA4. That can look contradictory. The website recorded an action, so why did Analytics miss it?
The answer starts with separating three things: the website message, the tag that uses it, and the event received by Analytics. A data layer connects those stages. It does not complete the whole measurement process by itself.
A data layer gives website actions a consistent meaning
In a typical GTM web setup, window.dataLayer is a JavaScript array. Website code adds messages to it. GTM processes those messages and uses their values when evaluating triggers and configuring tags.
This creates a useful boundary between application code and measurement. The website can report that a contact request succeeded. GTM can then decide which configured tags should respond.
Without that boundary, tracking may depend on button text, CSS classes or a message scraped from the page. A redesign can change those details. An agreed event definition can remain stable while the interface changes.
The agreement still needs maintenance. Renaming an event or changing a field can break the tags that expect it. A data layer makes the information explicit; someone must still own its definition.
Define when the event becomes true
Consider a hypothetical contact form for an analytics audit. The action to measure is a successfully accepted request. A click on Submit is an earlier action. Validation can fail, or the server can reject the request.
The application should therefore send the success message after it receives confirmation that the request was accepted. An illustrative message could look like this:
