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
| Layer | Container | ID | Purpose |
|---|---|---|---|
| Web | GTM web container | GTM-PGPK24VR (Pacing base) | Fires tags on-site, manages CID, routes events to server |
| Server | sGTM server container | GTM-NHVBMP3D (Pacing base) | Receives events, routes to ad platforms + BigQuery |
Platforms included out of the box
Web container
| Platform | Tag type | Consent required |
|---|---|---|
| GA4 (via sGTM) | Server Google Tag | None (not_needed) |
| Google Ads | Config (Signals) + Conversion Linker | NOT_SET |
| Meta Pixel | Platform tag | None (fires on consent init) |
| LinkedIn Insight | Platform tag | ad_storage |
| Pinterest Base | Platform tag | None |
| Reddit Pixel | Platform tag | NOT_SET |
| Microsoft Clarity | Platform tag | analytics_storage |
| Microsoft UET | UET base | None |
| Termly CMP | Consent management | None |
| rB2B | B2B identification | NOT_SET |
| Cloudflare Video | Custom HTML | NOT_SET |
| Client ID (CID) | Custom HTML x2 | None (consent init) |
Server container
| Platform | Tag type |
|---|---|
| GA4 (Advanced via Stape) | sGTM GA4 |
| Google Ads Conversions | sGTM Ads Conversion |
| Google Ads Conversion Linker | sGTM Conversion Linker |
| Meta CAPI | Platform tag |
| LinkedIn CAPI | Platform tag |
| Pinterest CAPI | Platform tag |
| BigQuery | Event logging |
Template version history
| Version | Containers | Key changes |
|---|---|---|
| v1 (current) | GTM-PGPK24VR workspace11, GTM-NHVBMP3D workspace10 | Pinterest + 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
| Variable | What to set |
|---|---|
Server Google Tag ID - Change | Client GA4 Measurement ID (e.g. G-XXXXXXXXXX) - this is also the stream used as the sGTM transport |
Tracking Server URL - Change | Client's custom sGTM domain (e.g. https://dt.clientname.com) |
Meta Pixel ID - Change | Client Meta Pixel ID |
LinkedIn Partner ID - Change | Client LinkedIn Partner ID |
Microsoft Clarity - Change | Client Clarity project ID |
GAds - Google Conversion ID - Change | Client Google Ads conversion ID (numeric, without AW-) |
Termly UUID - Change | Client Termly site UUID |
Pinterest - Tag ID | Client Pinterest advertiser/tag ID |
Reddit Pixel ID | Client Reddit pixel ID |
Client ID - Local Storage | Update the cookie/storage key from _c_pca to _c_xxx (client abbreviation) |
Cookie - Custom Client ID | Same - 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
| Variable | What to set |
|---|---|
Measurement ID | Client GA4 Measurement ID |
Server Google Tag ID - Change | Same - the sGTM stream ID |
GAds - Conversion ID - CHANGE | Client Google Ads conversion ID |
GAds - Conversion Label Lookup - Change | Map event names → conversion labels for this client |
Meta Pixel ID - Change | Client Meta Pixel ID |
Meta Access Token - Change | Client Meta CAPI access token |
Meta Event Name Lookup - Change | Map GA4 event names → Meta standard event names |
LinkedIn - Access Token - Change | Client LinkedIn CAPI access token |
LinkedIn - Conversion ID Lookup | Map event/client name → LinkedIn conversion ID |
Pinterest Access Token | Client Pinterest CAPI access token |
Pinterest - Advertiser ID | Client 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.
| Component | Pattern | Example |
|---|---|---|
| localStorage key | _c_xxx | _c_sct (Socratic Tutoring), _c_pca (Pacing) |
| Cookie name | Same as localStorage key | _c_sct |
| URL parameter | c_xxx | c_sct |
Priority: URL parameter → localStorage → cookie → generate new UUID.
Event architecture
Web container - key event names
| Event | Trigger | Sent to server? |
|---|---|---|
page_view | DOM Ready via Server Google Tag | Yes - all platforms |
glob-cta_click / glob-nav_click | Link click with matching CSS class | Yes - GA4 only |
[form-id]_form_submit | Webflow form submission | Yes - GA4 only unless matched below |
lead_form_submit | Webflow form | Yes - all ad platforms |
newsletter_form_submit | Webflow form | Yes - all ad platforms |
demo_form_submit | Webflow form | Yes - all ad platforms |
[id]_content_view | 50% element visibility | Yes - GA4 |
video_started / video_progress | Cloudflare Stream player | Yes - GA4 |
page_view_404 | DOM Ready on 404 | Yes - 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:
| Class | Event prefix/suffix |
|---|---|
glob-cta | CTA click event |
glob-nav | Nav 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
- Web container detail → Web Container Reference
- Server container detail → Server Container Reference
- Full GTM tool notes → Tools → Website → Google Tag Manager