TrackLead
←All articles

How to set up Google Tag Manager before going server-side

4 min read

Short answer: you set up Google Tag Manager properly with one account in the client’s name, one web container per site, the container code in the head and body, and then the Google tag and your conversion tags based on the dataLayer. Sort out consent from day one, use a fixed naming convention and test everything in Preview before you publish. Then the base for server-side is in place.

By the TrackLead team. Technically reviewed by Pieter. Updated: November 2026.

Create the account and container

  1. Go to tagmanager.google.com and create an account in the client’s name. The account belongs to the company; the container belongs to one website.

  2. Choose Web as the container type.

  3. Add the two code snippets GTM gives you: the script as high as possible in the <head> and the <noscript> part right after the opening <body> tag.

  4. Grant access: Administrator or User at account level, and Read, Edit, Approve or Publish at container level. Keep Publish to one or two people.

The first tags

  • The Google tag with the GA4 measurement ID (G-...), on all pages. This is the base for GA4 and Google Ads.

  • GA4 events for the actions that count, such as generate_lead or purchase, based on the dataLayer.

  • Conversion Linker on all pages if the client uses Google Ads.

  • Conversion tags for Google Ads, Meta and LinkedIn on the same events.

Have the website pass data through the dataLayer, for example dataLayer.push({event: 'generate_lead'}), instead of reading it off the page in GTM. That keeps working when the site design changes. Which conversions to track is covered in conversion tracking setup.

Naming and folders

Google doesn’t prescribe a naming convention, but a fixed format saves a lot of searching as the container grows. We use platform - type - what, such as GA4 - Event - generate_lead or Meta - Pixel - Lead. Do the same for triggers and variables, and put everything in a folder per platform.

  • Install the consent platform’s GTM template from the Community Template Gallery.

  • Fire it on the Consent Initialization - All Pages trigger, so the default state is set before other tags load.

  • Turn on the consent overview (Admin › Container settings) and check for each tag which consent it needs.

How to set up Consent Mode v2 step by step is covered in Consent Mode v2 in GTM.

Test and publish

  1. Click Preview. Tag Assistant opens your site and shows for each event which tags fired, which didn’t, and what was in the dataLayer.

  2. Check in GA4 DebugView and in the Meta Events Manager test tool that the events arrive.

  3. Publish with a clear version name and description, so you know later what changed and can roll back.

The free version of GTM allows up to three workspaces at a time. If several people work in one container, agree who publishes when.

When to move to server-side

A clean web container is the base for server-side. The web container keeps collecting the data; you then send it through the Google tag to your server container instead of straight to Google. What server-side involves is covered in server-side tagging explained. What to sort out before you start is in GTM server-side tracking: before you start. Taking over an existing container? Start with a GTM audit.

With TrackLead you set up the implementation in your client’s own GTM, on the host you already use, with monitoring included. Take a look at tracklead.eu.

Frequently asked questions

What is Google Tag Manager?

A free Google tool that lets you manage tags, such as the Google tag, the Meta Pixel and conversion tags, on your site without changing the code each time. You add the container code to the site once and manage everything in GTM afterwards.

How many containers do I need?

One web container per website. You only add a server container when you move to server-side.

Who should have access to GTM?

As few people as possible with the Publish permission. Give others Edit or Read. Let the client own the account and give the agency access as a user.

Yes. Adding it later means going through every tag again. With the Consent Initialization trigger you set the default state before other tags load.