Google Tag Manager and the data layer
In the plugin: Tracking Nexus → Platforms → Google Tag Manager
On this page
Use this page if you build your own tags in Google Tag Manager. Tracking Nexus loads your container and fills the data layer with page facts, leads and purchases, so your tags can read them. You do not need it to connect Meta, GA4 or the other platforms: they connect directly.
What you need first
Your Tag Manager container ID. It starts with GTM- and is shown at the top of your container in Tag Manager.
Connect your container
-
Open Tracking Nexus → Platforms and choose Google Tag Manager.
-
Paste your container ID into What is your Tag Manager container ID?
-
Press Save. The tile now shows your container.
(opens the full screen)
The container loads only when every platform it serves may run, which means after the visitor's consent allows them. The tags and consent templates inside the container stay your own to configure. See Google Consent Mode.
Advanced settings
Under Advanced (most sites skip this):
- Load the container from: your own tagging server, for example
https://data.example.com. Empty means Google. It must be an https address with no query or login in it. - Container path: empty means
/gtm.js. Set a custom path if your server serves the container elsewhere. - Environment gtm_auth and Environment gtm_preview: from the environment's snippet in Tag Manager (Admin, Environments). Enter both, for example
env-3for the preview value, or neither.
Let a platform send through your container
On any platform's page, choose Through Google Tag Manager under How should events reach …? Events then go to the data layer, and your container sends them to that platform. Without a container ID the platform needs one: its tile says Needs Tag Manager container ID. Extra pixels do not run through Tag Manager, because a container holds its own tags.
The data layer
The data layer is a list on each page that your own Tag Manager tags read. Nothing is pushed before the visitor allows analytics or advertising. Scroll down the Tag Manager page to Data layer.
First, Data layer variable is the name of the list. Keep dataLayer unless your container uses another name. A few names that would clash with the browser or with Tracking Nexus's own tags are refused and fall back to dataLayer.
Then, under What is pushed, switch each group on or off. The keys under each group are what your tags can read.
| Group | What your tags can read | On for new sites |
|---|---|---|
| Page | The page type, ID, post type, title and site language | On |
| Categories and tags | Up to 10 category, tag and product category names; the term of an archive | On |
| Author | The post author's display name | Off |
| Dates | When the post was published and last modified | Off |
| Site search | The search term and number of results (a term that looks like an email or phone number is dropped) | On |
| Visitor | Whether the visitor is signed in, and their role | On |
| Campaign | The visit's UTM tags, landing page and referring site, first and latest. Click IDs only when advertising matching is allowed. | On |
| Product (WooCommerce) | On product pages: ID, SKU, name, price, currency, stock status and category | On |
| Customer (WooCommerce) | For signed-in customers, after analytics consent: the number of paid orders and total spent | Off |
| Hashed email | A signed-in visitor's email, tidied up and hashed with SHA-256, only when advertising matching is allowed. For tags such as Google enhanced conversions. | Off |
| Events | Every tracked event, such as tn_scroll and tn_contact, with its details. Shop events go as GA4 ecommerce events (view_item, add_to_cart and so on). |
On |
| Leads and purchases | tn_lead with value, currency, form and source, and the GA4 purchase event |
On |
A customer's totals and hashed email are never printed in the page. They are fetched after consent and pushed as tn_visitor.
(opens the full screen)
The Preview card shows what your saved settings push on your latest post, page and product, plus example events. Changes apply when you save.
Test it
-
Visit your site where you have allowed analytics, and open Tag Manager's preview mode (Tag Assistant) on it.
-
Check that your container loads and that the data layer events appear. The Preview card on the Tag Manager page shows what to expect.
-
Send a test lead and check in Tag Manager's preview that the
tn_leadevent arrives with its value, form and source.
Common problems
The container does not load. It loads only when every platform it serves is allowed, so a visitor who has not consented sees nothing. Check consent first.
A platform says it needs a container ID. You chose Through Google Tag Manager for it. Add the container ID here, or choose another route on that platform's page.
My preview environment is ignored. Both Environment gtm_auth and Environment gtm_preview are needed.
Questions
Do I need Tag Manager to use Tracking Nexus?
No. Every platform connects directly with its own ID. Tag Manager is optional, for people who build their tags there.
Can I rename the data layer?
Yes, with Data layer variable. Google tags that Tracking Nexus loads are told the name.
Is anything pushed before consent?
No. Nothing is pushed before the visitor allows analytics or advertising.
Last updated 27 November 2026