Logo of TAGGRS, written in blue and with a small favicon
HomeServer-side Tracking
Start for free
Introduction
Get started
Get started with TAGGRSSet up Google Tag ManagerAdd the GTM Data LayerConfigure GTM transformationsTest the setupDebuggingAnalytics dashboard
Migrate from Google CloudMigrate from hosting
Shortcuts
GTM Copy PasteReady-made templates
GA4 Server-side Tracking
Setup in GTMCreate GA4 Event TagsGA4 tag setup in server containerE-commerce events in GTM
Google Ads Server-side Tracking
Install Conversion LinkerSet up Conversion TrackingConfigure Enhanced ConversionsDeploy Remarketing Tags
Facebook Server-side Tracking
Set Meta PixelImprove your EMQ ScoreInstall Meta CAPIMeta Events DeduplicationMeta CAPI Gateway
LinkedIn Server-side Tracking
Install LinkedIn Insight TagSet up LinkedIn CAPILinkedIn Events Deduplication
TikTok Server-side Tracking
Set up TikTok PixelInstall TikTok Events APITikTok Events Deduplication
Pinterest Server-side Tracking
Set up Pinterest TagConfigure Pinterest Conversions APIPinterest Events Deduplication
Snapchat Server-side Tracking
Set up Snap PixelSnapchat Conversions APISnapchat Events Deduplication
TAGGRS Tracking Tags and Tools
Tracking TagsGoogle Service Account integrationsGTM LogsProfit TrackingData Enricher ToolWebhooks TesterEnhanced Tracking ScriptMulti Domain ToolClick ID RecoveryConsent Tool
Configurations
Billy Grace Server-side TrackingLeadPages Server-side TrackingPiwik PRO Server-side TrackingCDN Server-side TrackingShopify Server-side TrackingActiveCampaign Server-side TrackingKlaviyo Server-side Tracking
Server-side Tracking for e-commerce
Shopify Data LayerShopware Data LayerMagento Data LayerWooCommerce Data LayerPrestashop Data LayerLightspeed Data Layer
Consent Management server-side
Activate Consent ModeConfigure TAGGRS with Axeptio

Set up Google Tag Manager Data Layer

This guide explains how to implement and use the Google Tag Manager (GTM) Data Layer for server-side tracking with TAGGRS. It also shows the use cases and its structure.
Logo of TAGGRS Server-side Tracking: a light blue circle with two blue angle brackets
Configuring a data layer is not mandatory to finalize the server-side tracking setup but it is highly recommendable for e-commerce stores.
Do you have a regular website with basic tracking needs? Go straight to our GTM transformations guide.

What is a Data Layer?

A Data Layer in GTM is a JavaScript array that acts as the main data transport mechanism between your website/app and Google Tag Manager. For Server-side Tracking, a Data Layer ensures that all relevant events and parameters are consistently captured and transmitted from the client (web container) to the server container for downstream processing.
Screenshot from Google Tag Manager showing the built-in variables that can be configured

Data Layer's use cases

When it comes to basic event tracking, such as pageviews, Data Layers are usually not needed, built-in GTM variables may suffice.

So, when Data Layers come in handy?

  • To enhance data completeness and reliability in case of advanced or custom events, such as purchases, multi-step forms, or custom event tracking
  • To achieve accurate event forwarding and data integrity in your server-side tracking.

The structure of a Data Layer

The Data Layer work client to server. Here is the data flow:
1. Event occurs on the website (e.g., purchase completed).
2. Data Layer is updated with the event and relevant parameters.
3. GTM web container reads the Data Layer and triggers tags or variables as configured.
4. Event data is sent to the GTM server container endpoint via the server_container_url parameter in your GA4 tag configuration.
5. Server container processes the event and forwards or transforms data as needed for analytics, marketing, or custom endpoints.

The Data Layer is initialized as a global JavaScript array:

window.dataLayer = window.dataLayer || [];

Events and parameters are pushed using:

window.dataLayer.push({
  event: 'purchase',
  transaction_id: '12345',
  value: 99.99,
  currency: 'EUR',
1.   items: [{ id: 'sku-1', name: 'Product A', quantity: 1 }]
});

Best practices

  • Use clear, consistent naming for events and parameters.
  • Align your structure with the requirements of your analytics or marketing platforms (e.g. GA4 Enhanced Ecommerce).

How to configure GTM Data Layer: 5-step setup

1. Define the Data Layer structure

Identify all events and parameters required for your tracking and reporting needs.

2. Implement Data Layer pushes

Add dataLayer.push()statements to your site code at the appropriate interaction points (e.g., after a successful checkout).

3. Configure Data Layer Variables in GTM

In GTM, create Data Layer Variables for each parameter you need to access in tags or triggers.

4. Set up triggers and tags

Use Custom Event triggers that listen for specific event values in the Data Layer. Configure tags to fire when these triggers are met.

5. Test in GTM Preview Mode

Use GTM’s Preview Mode and server-side Preview tools to verify that events and parameters are captured and processed as expected.

Data layer for any e-commerce: TAGGRS documentation

You can develop a Data Layers manually, but we developed 5 plugins for the most used e-commerce platforms to help you save time.

Shopify Data Layer

Magento Data Layer

WooCommerce Data Layer

Lightspeed Data Layer

Prestashop Data Layer

Useful resources

Find expert support
Previous
Set up GTM
Next
Transformations in GTM
DOCUMENTATION V1.3
Copyright © 2025 TAGGRS. All right reserved.
TABLE OF CONTENTS
What is a Data Layer?Data Layer's use casesData Layer structureBest practicesGTM Data Layer configurationBest practicesE-commerce data layerUseful resources