Skip to main content

Pacing GTM Template

The Pacing Agency GTM Template is a standardised two-container setup for Google Tag Manager that covers web tracking and server-side tag routing. It is the starting point for every new client project.

What it covers

LayerContainerIDPurpose
WebGTM web containerGTM-PGPK24VR (Pacing base)Fires tags on-site, manages CID, routes events to server
ServersGTM server containerGTM-NHVBMP3D (Pacing base)Receives events, routes to ad platforms + BigQuery

Platforms included out of the box

Web container

PlatformTag typeConsent required
GA4 (via sGTM)Server Google TagNone (not_needed)
Google AdsConfig (Signals) + Conversion LinkerNOT_SET
Meta PixelPlatform tagNone (fires on consent init)
LinkedIn InsightPlatform tagad_storage
Pinterest BasePlatform tagNone
Reddit PixelPlatform tagNOT_SET
Microsoft ClarityPlatform taganalytics_storage
Microsoft UETUET baseNone
Termly CMPConsent managementNone
rB2BB2B identificationNOT_SET
Cloudflare VideoCustom HTMLNOT_SET
Client ID (CID)Custom HTML x2None (consent init)

Server container

PlatformTag type
GA4 (Advanced via Stape)sGTM GA4
Google Ads ConversionssGTM Ads Conversion
Google Ads Conversion LinkersGTM Conversion Linker
Meta CAPIPlatform tag
LinkedIn CAPIPlatform tag
Pinterest CAPIPlatform tag
BigQueryEvent logging

Template version history

VersionContainersKey changes
v1 (current)GTM-PGPK24VR workspace11, GTM-NHVBMP3D workspace10Pinterest + Reddit added; CID sync tag added; Cloudflare video tracking added

Exported JSON files are stored in the workspace (not on the docs site).


Per-client setup

When deploying the template for a new client, create a copy of the Pacing web and server containers in GTM, then update all variables ending in - Change.

Web container - variables to update

VariableWhat to set
Server Google Tag ID - ChangeClient GA4 Measurement ID (e.g. G-XXXXXXXXXX) - this is also the stream used as the sGTM transport
Tracking Server URL - ChangeClient's custom sGTM domain (e.g. https://dt.clientname.com)
Meta Pixel ID - ChangeClient Meta Pixel ID
LinkedIn Partner ID - ChangeClient LinkedIn Partner ID
Microsoft Clarity - ChangeClient Clarity project ID
GAds - Google Conversion ID - ChangeClient Google Ads conversion ID (numeric, without AW-)
Termly UUID - ChangeClient Termly site UUID
Pinterest - Tag IDClient Pinterest advertiser/tag ID
Reddit Pixel IDClient Reddit pixel ID
Client ID - Local StorageUpdate the cookie/storage key from _c_pca to _c_xxx (client abbreviation)
Cookie - Custom Client IDSame - update the cookie name

Also update the hardcoded cookie name _c_pca_c_xxx in the two CID tags (Set Client ID - Cookie and Set Client ID - Local Storage).

Server container - variables to update

VariableWhat to set
Measurement IDClient GA4 Measurement ID
Server Google Tag ID - ChangeSame - the sGTM stream ID
GAds - Conversion ID - CHANGEClient Google Ads conversion ID
GAds - Conversion Label Lookup - ChangeMap event names → conversion labels for this client
Meta Pixel ID - ChangeClient Meta Pixel ID
Meta Access Token - ChangeClient Meta CAPI access token
Meta Event Name Lookup - ChangeMap GA4 event names → Meta standard event names
LinkedIn - Access Token - ChangeClient LinkedIn CAPI access token
LinkedIn - Conversion ID LookupMap event/client name → LinkedIn conversion ID
Pinterest Access TokenClient Pinterest CAPI access token
Pinterest - Advertiser IDClient Pinterest advertiser ID

Security: Access tokens should never appear in documentation or be committed to git. Store them in the GTM container variables only. Rotate tokens if a container export is shared outside the agency.


CID naming convention

Each client gets a unique first-party tracking ID stored in both localStorage and a cookie.

ComponentPatternExample
localStorage key_c_xxx_c_sct (Socratic Tutoring), _c_pca (Pacing)
Cookie nameSame as localStorage key_c_sct
URL parameterc_xxxc_sct

Priority: URL parameter → localStorage → cookie → generate new UUID.


Event architecture

Web container - key event names

EventTriggerSent to server?
page_viewDOM Ready via Server Google TagYes - all platforms
glob-cta_click / glob-nav_clickLink click with matching CSS classYes - GA4 only
[form-id]_form_submitWebflow form submissionYes - GA4 only unless matched below
lead_form_submitWebflow formYes - all ad platforms
newsletter_form_submitWebflow formYes - all ad platforms
demo_form_submitWebflow formYes - all ad platforms
[id]_content_view50% element visibilityYes - GA4
video_started / video_progressCloudflare Stream playerYes - GA4
page_view_404DOM Ready on 404Yes - GA4

Server container - routing rules

Events arriving at sGTM are routed as follows:

All events → GA4 (except exclusions)
lead_form_submit | newsletter_form_submit | demo_form_submit → Google Ads + Meta CAPI + LinkedIn CAPI
generate_lead → GA4 Advanced (Stape)
All events → BigQuery

Platform-specific event triggers (Meta Specific Events, LinkedIn Specific Events, Google Ads Specific Events, GA - Event Exclusions) contain placeholder regexes (event1|event2) that should be updated per client if additional routing is needed.


CSS class naming convention

The web container uses CSS classes on HTML elements to determine event names:

ClassEvent prefix/suffix
glob-ctaCTA click event
glob-navNav link click event

All global tracking classes use the glob- prefix. Add to the Event Name Prefix Handler - Lookup and Event Name Suffix Handler - Lookup regex tables in GTM when adding new tracked elements.


GTM Analyzer

The workspace includes a script to parse any GTM JSON export and generate structured CSVs.

# Analyze the Pacing web container
node scripts/resources/gtm/gtm-analyzer.js scripts/resources/gtm/GTM-PGPK24VR_workspace11.json

# Analyze a client export (drop into test/ which is gitignored)
node scripts/resources/gtm/gtm-analyzer.js test/GTM/client-export.json

Output is written to a timestamped subfolder alongside the input file. See the GTM Analyzer script page for full usage.


Further reading