Skip to main content
All CollectionsTracking scriptsCustom integrations
How to add Datatrics tracking and e-commerce scripts in Google Tag Manager
How to add Datatrics tracking and e-commerce scripts in Google Tag Manager

This article guides you through the process of placing the Datatrics tracking and e-commerce scripts on your website via Google Tag Manager.

Christiaan Proper avatar
Written by Christiaan Proper
Updated over a week ago

If you’ve never used Google Tag Manager before yourself or want a refresher on how it works, please read this article first. It explains Google Tag Manager, variables, tags, triggers, containers, workspaces, preview mode, and the Tag Assistant. It’s essential to know about these topics since they will be referred to a lot in the upcoming articles.

Implementing the Datatrics tracking script

Now that you know what Google Tag Manager (GTM) is, let’s start implementing the Datatrics tracking script to your GTM container. There are two ways of implementing this code, depending on what type of website you have.

If you have a website where the page reloads every time the content changes (the classical approach to web development, also known as Multi-Page Applications (MPAs), please follow this guide to implement the Datatrics tracking script:

If your website doesn’t reload for every page view and when content changes, your website is a Single Page Application (SPA). This more modern approach to app development requires a different setup in Google Tag Manager. Please use the article below for the implementation:

Implementing the Datatrics e-commerce scripts

Implementing the e-commerce scripts fully depends on your Google Tag Manager setup and how you implemented Google Tag Manager e-commerce events on your website.

There are three different standards for implementing e-commerce events for Google Tag Manager:

Not sure which version of e-commerce events you have on your website?

When it’s clear which version is implemented at your site and follow the corresponding instruction:

Did this answer your question?