dataLayer
What is a dataLayer?
A dataLayer is a JavaScript object (technically an array named window.dataLayer) that a website uses to expose structured data to tracking tools. The website "pushes" events to the dataLayer, such as a purchase with the order number, order value, currency, and a list of products. The idea is to keep the website itself separate from the tracking setup: the site delivers the data in one place, and the tags read it from there.
How Google Tag Manager uses the dataLayer
Google Tag Manager listens to the dataLayer: triggers react to events, and variables read the values, which are then passed on to GA4, Meta, and other platforms. For online stores, the dataLayer is the standard behind GA4's ecommerce events such as view_item, add_to_cart, and purchase.
The dataLayer in Shoporama
Shoporama's built-in tracking automatically pushes ecommerce events to the dataLayer on all relevant pages: product views, category and search results, add to cart, checkout steps, and purchases. It requires no changes to your theme, and you do not need to set up a Tag Manager container yourself.
If you build your own theme or want to extend your tracking, read more in the developer guide Implement tracking in your theme.
How to do it in Shoporama
Guides that show the term in practice
HTML fields: add Cookiebot, GTM, and other scripts to your store
How to use HTML fields in Shoporama to add Cookiebot, Google Tag Manager, Facebook Pixel, chat widgets, and other...
Implement ecommerce tracking in a Shoporama theme
Developer guide to ecommerce tracking in a Shoporama theme: the data layer, Google Tag Manager, custom events, and...
Set up ecommerce tracking in your Shoporama store
Enable Shoporama's built-in tracking and send accurate tracking data to Facebook, Google Ads, GA4, TikTok, and more....
We know online marketing at Shoporama
We have worked with online marketing ourselves for decades. As the only e-commerce platform in Denmark, we have spoken several times at conferences such as Marketingcamp, SEOday, Shopcamp, Digital Marketing, E-commerce manageren, Ehandelsdagen, Web Analytics Wednesday, and many more.