GTM cleanup and server-side lead conversions

A GTM container that had grown over years on a lead-generation website was cleaned up, and the Google Ads lead conversions were moved to the server container.

Context
Lead generation, corporate website
Focus
Audit, container cleanup, server-side migration
Period
2024–2025
Stack
  • Server-side tagging
  • GTM web & server
  • GA4
  • Google Ads & Enhanced Conversions
  • Meta Pixel
  • CMP

Background

The GTM container of an established lead-generation website still contained Universal Analytics leftovers, unused tags and variables, and a faulty Meta Pixel integration. Naming was inconsistent and folders were missing. The website was also to move to server-side conversions and Enhanced Conversions.

Implementation

The starting point was an audit of GTM, the CMP, and the relevant website code. It resulted in a cleanup and migration plan with effort estimates.

Clicks and forms are identified through HTML data attributes. The IDs in them are fixed, so tracking no longer depends on the page’s classes or text. The lead events have new, unambiguous names and are mapped to the conversion labels in Google Ads in the server container. For Enhanced Conversions, the form data is passed explicitly instead of being read automatically from the page.

During the migration, the question came up of sending the same conversion from the browser and the server at the same time. Without a shared deduplication field, Google Ads then counts a lead twice. The recommendation was therefore to use only one path per conversion, or to create separate conversions for testing.

The new conversions were checked in GTM preview and in GA4 DebugView. On related websites, the CMP setup was also supported on the technical side.

Result

The container is clean and consistently named. Lead conversions run through the server container, and form and click tracking keeps working reliably after changes to the page layout.