Skip to content
Web Design & Development

Data Layer Design: The Decisions That Matter

The structured object on a page that supplies analytics and tag tools with consistent data.

MediaScaleUp Editorial Team 2 min read 14 views
Data Layer Design: The Decisions That Matter

Why does it matter?

Without a data layer, tags scrape the page and break whenever the markup changes.

What are the numbers?

  • Structure a defined schema keeps values consistent
  • Timing data must be available before tags fire
  • Naming consistent naming across pages prevents fragmentation
  • Documentation the schema needs a maintained specification

What should I do?

  1. Define and document a data layer schema
  2. Populate values server-side where possible
  3. Keep naming consistent across page types
  4. Version the specification
  5. Test the data layer in staging
What to do and what to avoid with data layer design, side by side
Good practice against the usual mistakes, from the sources listed below.

What should I avoid?

Avoid:

  • Tags reading values from the DOM
  • Different names for the same value
  • Undocumented data layer changes
  • Values populated after tags fire

When should I get help?

Short answer Bring in help when analytics break after releases.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development