
If you’ve ever tried to set up tracking with Google Tag Manager (GTM), Google Analytics, or ads tools like Facebook Pixel or Google Ads—you’ve probably come across something called the dataLayer.
It sounds technical, but it’s actually just a simple way to help your tracking tools understand what’s happening on your site.
Let’s walk through what it is, why it matters, and how it works—with examples anyone can understand.
What is the dataLayer?
The dataLayer is a small place in your website’s code where you store information about what users are doing. This could be things like:
- What page someone is viewing
- What product they added to the cart
- How much their order cost
- Whether they signed up for your newsletter
This information is not visible to users, but it can be read by tracking tools like GTM. Once the data is there, those tools know exactly what happened and when.
Your website already “knows” what’s happening—like which product is being viewed, what the price is, and who is logged in. But tools like Google Tag Manager don’t automatically have access to that info.
Without a dataLayer, tracking tools have to dig around in your site’s code to find this data. That’s messy, unreliable, and often breaks when your site changes.
The dataLayer fixes this. Now your tools know exactly what’s going on—no guesswork.
The dataLayer is written in JavaScript. But don’t worry—it’s just a short piece of code that looks like this:
Here’s what it means:
- event: What just happened (in this case, someone viewed a product)
- name: Nike Air Max
- price: $129.99
- category: Shoes
This data sits quietly in the background and waits for a tool like GTM to pick it up and send it to your analytics or ad platforms, which is what we, as marketers, need.
What’s the Point of All This?
Without the dataLayer, setting up tracking is frustrating.
- You’d have to dig around your site’s code to find the info you need.
- Every tool (Google Ads, Facebook, GA4) would need its own special setup.
- And if your site changes, it could break everything.
With the dataLayer:
- You push clean data once
- Every tool can use it
- It’s easier to manage, scale, and debug
Basically, the dataLayer becomes the single source of truth for what’s happening on your site. Tracking becomes more accurate and less stressful.
How to check if you have a dataLayer?
There are a few ways you can do it.
Inspect page
- Go to your website
- Right-click → Inspect
- Go to the Console tab
Type “datalayer“.
What you’ll see:
If the dataLayer exists, you’ll see an array of objects (like [ {event: “page_view”} ])
However, it doesn’t always work, as you can see in the image.
View page source
Similar to the above, but here we’re viewing your page source.
- Go to your website
- Right-click → View Page source
- Do a search for “datalayer” (CTRL+ F, or Cmd+F)
You should see datalayer highlighted.
This does not mean that the dataLayer is working correctly unless you are a developer and can read JavaScript. Sometimes, I see that the code has been placed, but there might be some small punctuation or other mistakes.
Using GTM
This is probably the easiest way. Of course, if you have GTM installed. But when you use the Preview mode there is a special tab for the dataLayer.
Go to your product page, for example. Then click in the summary on that page and then on the right switch the view to Data Layer.
You should see a bunch of information, like product id, item category, price etc. This is how you know that the dataLayer is on your site and GTM can see what is happening.
What if I don’t have a dataLayer?
Then you need to be on good terms with your developer. I’m kidding, but in my experience, many developers hate marketing tasks.
You need to ask your developers to create one for your website. It’s not complicated at all, just takes a bit of time.
Here’s some documentation about dataLayer from Google.
Here’s how to prepare for the task:
- Go through your website and write down what actions you want to add to the dataLayer
- form submissions
- e-commerce events: add to cart, checkout, purchase etc.
- Downloads
- Whatever you need to track
- List down what information the event should contain. It can be just the event itself, so you can track it or additional information with it.
- For example, form submission: name, email, phone number et.
- Create a task for the developer explaining the benefits to marketing and tracking.
You can always add things to the dataLayer later, but if you can, it’s best to do it in one go.
Using CMS: WordPress, Prestashop, Shopify?
No matter what content management system you use, before asking developers anything, check if there is a plugin.
For example, I know that Woocommerce has a built-in dataLayer, and you just have to enable it. However, it’s for e-commerce purchases. If you need to track custom events, you may need a developer after all.
WordPress
Does it support dataLayer? ✅ Yes
Plugins:
- DuracellTomi’s Google Tag Manager for WordPress – most popular GTM plugin, supports custom dataLayer variables
- PixelYourSite – supports dataLayer for Facebook + Google tracking
- WooCommerce plugins often push ecommerce data to dataLayer automatically (e.g., WooCommerce GTM plugin)
Good for: Page views, eCommerce (WooCommerce), form submissions
Shopify
Does it support dataLayer? ✅ Yes, with apps or custom code
Apps/Tools:
- Elevar – full GTM + dataLayer support, plug-and-play
- DataLayer Manager (via theme or app)
- Manual insertion in theme.liquid
Good for: Add to cart, purchases, product views, etc.
Magento / Adobe Commerce
Does it support dataLayer? ✅ Yes (natively + plugins)
Extensions:
- Google Tag Manager by MagePal – excellent for pushing ecommerce data to dataLayer
- GTAG Enhanced Ecommerce
- Often includes Enhanced Ecommerce support out of the box
Wix
Does it support dataLayer? 🟡 Kind of (limited)
- No official GTM/dataLayer plugin
- You can embed GTM manually, but pushing custom events into dataLayer is limited unless you use Velo (Wix’s dev platform)
Squarespace
Does it support dataLayer? 🔴 Not natively
- You can add GTM via code injection
But pushing custom dataLayer events requires advanced code injection or workarounds — not ideal for ecommerce or dynamic tracking
Webflow
Does it support dataLayer? 🟡 Partially
- Can inject GTM and manually add dataLayer.push in page code
- No plugin system — you have to manage events manually
Better for developers or technical users.
BigCommerce
Does it support dataLayer? ✅ Yes
- Built-in support for Google Tag Manager and Enhanced Ecommerce
- You can customize the dataLayer via theme files or use apps like Elevar
Prestashop
Does it support dataLayer? ✅ Yes
- Has GTM + dataLayer modules available (free and paid)
- Often used in European ecommerce setups

Blogging gives me a chance to share my extensive experience with Google Ads. I hope you will find my posts useful. I try to write once a week, and you’re welcome to join my newsletter. Or we can connect on LinkedIn.