{# DE + SK hreflang odebráno 2026-05-24 — viz core/settings.py LANGUAGES. cross_lang_alternates is set False by views whose CS/EN versions live on DIFFERENT paths (KB articles/categories, blog posts) — there the naive same-path alternate would point at a non-existent URL, so we emit only the self-canonical instead of a wrong reciprocal. #} Skip to content

The data layer: the invisible foundation of good measurement

Without a clean data layer, even server-side tracking is only as good as the data it receives. What the data layer is, what good looks like and why everything rests on it.

D
DataNostro Team 7. 6. 2026 · 9 min · Intermediate

The data layer doesn't get much attention, but it's the most important part of the whole measurement stack. However good your server-side tracking is, it only sends what it receives from the data layer. A bad data layer means bad data, period. Here's what it is and how to get it right.

What the data layer is

The data layer is a JavaScript array (window.dataLayer) where your site stores structured information about what's happening — which product a visitor is viewing, what they added to cart, which order they completed. Google Tag Manager reads from this array and forwards the data to your measurement tools.

It's a layer between your site and your measurement. Instead of every tag "scraping" the page HTML, it reads clean, deliberate data from one place.

What a correct e-commerce data layer looks like

For e-commerce, GA4 has a standardized event format. A purchase, for example, carries fields like:

  • transaction_id — a unique order ID (crucial for deduplication and matching);
  • value and currency — the order's value and currency;
  • items — an array of products with ID, name, price, quantity and category.

The same structure powers GA4, Meta CAPI and Google Ads. When the data layer is right, connecting more platforms is a matter of mapping, not programming.

Common data layer mistakes

  • Missing transaction_id — without it conversions duplicate and you can't deduplicate. See the Meta CAPI guide.
  • Value as text instead of a number"$12.90" instead of 12.90 breaks revenue totals.
  • Data layer push after the tag loads — the event arrives too late and the tag misses it.
  • Inconsistent namesvalue in one place, price in another; measurement no longer adds up.

Why it matters doubly with server-side

Server-side tracking takes data from the site (via web GTM) and forwards it. It's a robust delivery mechanism — but it doesn't generate data, it only passes it on. If bad data flows in from a broken data layer, server-side faithfully forwards it to every platform. A clean data layer is therefore the first step, before any server-side deployment.

How to verify the data layer works

  • In GTM preview mode, watch which events and values come through.
  • In GA4 DebugView, verify the purchase carries the correct value, currency and items.
  • Compare the count and value of orders in your store with the data in GA4.

Summary

The data layer is the foundation the accuracy of all measurement rests on. Investing in a clean, consistent data layer pays back in data you can trust — and only on top of it does server-side tracking make full sense. Continue with the complete guide to server-side tracking or the sGTM basics in the docs.

Share

A new article once a month

In-depth server-side tracking guides + case studies from the CZ market. No spam, just 1 email a month. Unsubscribe anytime.

Back to Tracking