Real-world scenarios where this applies
1. Ecommerce transactions (common case where dataLayer is needed)
In ecommerce, a dataLayer is often essential because many order details — such as transaction ID, order value, items purchased, categories, and upsell activity — are not present in the page source. After the transaction is processed, developers push these values into the dataLayer so tracking tools can read them in a structured way.
2. Dynamic forms (may need a dataLayer)
If you’re using a HubSpot form with dynamic behaviour — for example, a date selection that reveals new fields — a dataLayer can help pass those internal selections to your tracking tools.
But for simple, static HubSpot forms, non-dataLayer tracking is usually enough.
3. Cross-platform tracking (dataLayer improves consistency)
When sending events to multiple platforms like Google Ads, Facebook, or LinkedIn, a dataLayer helps ensure the event names and values stay consistent.
It’s technically possible without a dataLayer, but far more fragile and time-consuming.
Why this decisioning is important
dataLayer work typically depends on your development team. If most of your measurement involves basic interactions like form submissions or button clicks and you’re not sending data to many platforms – marketing teams can often implement tracking themselves for a much faster turnaround.
When you do, do you just use the dataLayer?
You don’t have to. Tracking can also be a hybrid of both dataLayer and non-dataLayer set ups.
For example, if your marketing team wants to test a simple on-page variation like a video hero vs a screenshot of your SaaS product*, you may want to send the results to Google Analytics. Developers could modify the dataLayer for this, but temporary changes consume time and need to be reversed later. In such cases, it’s usually faster for marketing to track this directly without the dataLayer.
*Acc to an analysis by DoWhatWorks, video lost to image and product videos are a weak bet 😉
While a dataLayer is extremely useful for long-term, scalable tracking, match the approach to your resources, timelines, and whether the change is temporary.
Why is it written as “dataLayer” (lowercase d, uppercase L)?
dataLayer was popularized by Google Tag Manager.
Although you can name your data layer anything — and even have multiple layers on one page — each one needs a unique name. GTM standardized dataLayer, and it became the common convention.
Decision Checklist (use this before implementing a dataLayer)
0 Comments