SlideShare a Scribd company logo
Markus Baersch
Replacing gtag.js with walker.js
Why? How?
Demo: Running GA4 Using ssGTM
Replacing gtag.js with walker.js
Why Not GTAG.JS?
(yes, same old song - but only a very brief summary. And a new color! Yay!)
gtag.js
some issues
(shortened version)
Source: likely to be blocked
Heavy: UA, GA4, GAds, Optimize,
partner badges + stuff
Not a “Stream To Rule Them All”:
no data without consent.
Consent Mode is not an option!
gtag.js
… is odd!
(also shortened version)
GA4 Session Handling & More:
● “first_visit” and “session_start”
● Conversions
● referral exclusion
● public measurement id
Options:
● ga4mp.dev by David Vallejo (->
ssGTM)
● Build your own format and send
to own endpoint Or use existing
tools like CDPs, Tealium (see
slides from MC Berlin 2022)
But:
● Blocking might still be a problem
● Costs?
● Control?
Alternatives exist!
perfect fit?
Feeding GA4 with walker.js
Open source: walker.js is a maintained
repo on GitHub
(Can) have all data you need: there
are timestamps, timings, hit
numbers…
https://github.com/elbwalker/walker.js
elbwalker
open source event tracker
Tagging Basics
uses a command / event queue
called “elbLayer” (per default)
scans DOM for data-elb attributes
and builds events and parameters
alternatively push events to
elbLayer manually via JavaScript
can send events to several
destinations
Destinations are consent sensitive
(walker.js can handle consent) https://github.com/elbwalker/sgtm-client-template/tree/main/example
events have an “open” structure to
contain default attributes, custom
attributes, session state, user
information, references… or whatever
Send example:
elb('page view',
{id: '/test/virtual/path1',
title: 'Virtual Page 1'},
'click',
{some_property: 14}
);
Events
Sending Stuff: walker.js Destinations
Every destination can handle events individually. We use it to send data to a ssGTM endpoint
GA4 Session Handling
GA4 wants session handling
(simple) example…
- is only active if consent is
present
- uses localStorage /
sessionStorage - which is
only possible on a single
domain AND host
- Can be part of destination
init block (see example code
for ssGTM tag)
elb("walker user",
{hash: sD.sessionId,
device: sD.clientId});
Tagging: GTM Tag Template
github.com/elbwalker/gtm-tag-template
Custom Templates for walker,js
Configuration
and walker,js Events to migrate
GTM setups
- destinations
- GA4 session data
- ecom item conversion
- use your existing variables
Endpoints
● use ssGTM and translate walker events to ssGTM event model
○ trigger / fire any tags as if gtag.js did generate all requests
● or build your own in Node, PHP or whatever and forward events to
GA4
○ cloud edge endpoints actually are an option ;)
● Remember: CNAME is not an option to avoid browser tracking
protection issues
ssGTM Example
use custom client for walker events
basic example and client template
available on Github:
github.com/elbwalker/
sgtm-client-template
-> fork and build what you need
(contribute if you like!)
send data to GA4 using
standard tag
enrich server-side
dimensions
add debug flag for
better debugging (kill
before publishing ;))
ssGTM Example
… or send data
(additionally or
exclusively) to Piwik
PRO, Matomo…
… or send directly to
BigQuery as
event-level raw data
ssGTM Example
Demo
sending events…
… from client-side GTM…
-> to ssGTM
-> to GA4
Medium article:
mbaersch.medium.com/
A-better-solution-for-ga4-
Data-capturing-replacing-
gtag-js-with-walker-js-
2b9fd291d919
No ssGTM? Use: worker for walker events
forward (few data) to GA4 using GAMP V2
think: add event to D1 cloud database ;)
Or build your endpoint as
- AWS Lambda
- GCP Cloud Function
- Azure Function
Cloud Functions & Workers
Can you see it?
Done!
Questions?
Game On!
download and play:
Walker | GTM Tags | Client | BQ:
github.com/elbwalker
Order:
markus-baersch.de/gtmbook

More Related Content

More from 📊 Markus Baersch (20)

PDF
Effizientes Tag Management: Expertentipps & schlanke Set-ups
📊 Markus Baersch
 
PDF
Effektives Ereignis-Management in Google Tag Manager
📊 Markus Baersch
 
PDF
Tipps für das ideale GA4 E-Commerce Setup
📊 Markus Baersch
 
PDF
Piwik PRO Near Real-Time Alerting [MeasureCamp]
📊 Markus Baersch
 
PDF
"Clever & Smart" Conversion Management - Efficient Tagging in Google Tag Manager
📊 Markus Baersch
 
PDF
GA4 Without Cookies [Measure Camp AMS]
📊 Markus Baersch
 
PDF
Consent & Tag Management - die ultimative Checkliste
📊 Markus Baersch
 
PDF
Custom Tag Manager Templates
📊 Markus Baersch
 
PDF
Conversion Tracking Optionen im Vergleich
📊 Markus Baersch
 
PPTX
First Party Conversion Tracking [SEAcamp]
📊 Markus Baersch
 
PPTX
Ist Google Analytics noch zu retten?
📊 Markus Baersch
 
PPTX
Server-Side: Lösung für alles? [OMX]
📊 Markus Baersch
 
PDF
Google Analytics 4 - OMT
📊 Markus Baersch
 
PPTX
Google Ads Conversiontracking ohne Cookies -SEA CAMP
📊 Markus Baersch
 
PPTX
Google Analytics 4 : 10 Stolperfallen, 10 Verbesserungen + 5 Tipps [Campixx 2...
📊 Markus Baersch
 
PPTX
Google Tag Manager Templates
📊 Markus Baersch
 
PPTX
Tracking ist nicht kaputt!
📊 Markus Baersch
 
PPTX
Server-Side Google Tag Manager: Was, wie und warum
📊 Markus Baersch
 
PPTX
Google Consent Mode / MC Europe 2021
📊 Markus Baersch
 
PDF
First Party Data Collection
📊 Markus Baersch
 
Effizientes Tag Management: Expertentipps & schlanke Set-ups
📊 Markus Baersch
 
Effektives Ereignis-Management in Google Tag Manager
📊 Markus Baersch
 
Tipps für das ideale GA4 E-Commerce Setup
📊 Markus Baersch
 
Piwik PRO Near Real-Time Alerting [MeasureCamp]
📊 Markus Baersch
 
"Clever & Smart" Conversion Management - Efficient Tagging in Google Tag Manager
📊 Markus Baersch
 
GA4 Without Cookies [Measure Camp AMS]
📊 Markus Baersch
 
Consent & Tag Management - die ultimative Checkliste
📊 Markus Baersch
 
Custom Tag Manager Templates
📊 Markus Baersch
 
Conversion Tracking Optionen im Vergleich
📊 Markus Baersch
 
First Party Conversion Tracking [SEAcamp]
📊 Markus Baersch
 
Ist Google Analytics noch zu retten?
📊 Markus Baersch
 
Server-Side: Lösung für alles? [OMX]
📊 Markus Baersch
 
Google Analytics 4 - OMT
📊 Markus Baersch
 
Google Ads Conversiontracking ohne Cookies -SEA CAMP
📊 Markus Baersch
 
Google Analytics 4 : 10 Stolperfallen, 10 Verbesserungen + 5 Tipps [Campixx 2...
📊 Markus Baersch
 
Google Tag Manager Templates
📊 Markus Baersch
 
Tracking ist nicht kaputt!
📊 Markus Baersch
 
Server-Side Google Tag Manager: Was, wie und warum
📊 Markus Baersch
 
Google Consent Mode / MC Europe 2021
📊 Markus Baersch
 
First Party Data Collection
📊 Markus Baersch
 

Recently uploaded (20)

PDF
apidays Singapore 2025 - Building a Federated Future, Alex Szomora (GSMA)
apidays
 
PPTX
01_Nico Vincent_Sailpeak.pptx_AI_Barometer_2025
FinTech Belgium
 
PDF
apidays Singapore 2025 - Streaming Lakehouse with Kafka, Flink and Iceberg by...
apidays
 
PPTX
Presentation.pptx hhgihyugyygyijguuffddfffffff
abhiruppal2007
 
PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PDF
5991-5857_Agilent_MS_Theory_EN (1).pdf. pdf
NohaSalah45
 
PDF
Data Science Course Certificate by Sigma Software University
Stepan Kalika
 
PDF
Using AI/ML for Space Biology Research.pdf
VICTOR MAESTRE RAMIREZ
 
PPTX
05_Jelle Baats_Tekst.pptx_AI_Barometer_Release_Event
FinTech Belgium
 
PPTX
Feb 2021 Ransomware Recovery presentation.pptx
enginsayin1
 
PDF
Technical-Report-GPS_GIS_RS-for-MSF-finalv2.pdf
KPycho
 
PPTX
How to Add Columns and Rows in an R Data Frame
subhashenia
 
PDF
Business implication of Artificial Intelligence.pdf
VishalChugh12
 
PDF
apidays Singapore 2025 - Trustworthy Generative AI: The Role of Observability...
apidays
 
PDF
SQL for Accountants and Finance Managers
ysmaelreyes
 
PPTX
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
PDF
Research Methodology Overview Introduction
ayeshagul29594
 
PDF
UNISE-Operation-Procedure-InDHIS2trainng
ahmedabduselam23
 
PDF
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
PDF
NIS2 Compliance for MSPs: Roadmap, Benefits & Cybersecurity Trends (2025 Guide)
GRC Kompas
 
apidays Singapore 2025 - Building a Federated Future, Alex Szomora (GSMA)
apidays
 
01_Nico Vincent_Sailpeak.pptx_AI_Barometer_2025
FinTech Belgium
 
apidays Singapore 2025 - Streaming Lakehouse with Kafka, Flink and Iceberg by...
apidays
 
Presentation.pptx hhgihyugyygyijguuffddfffffff
abhiruppal2007
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
5991-5857_Agilent_MS_Theory_EN (1).pdf. pdf
NohaSalah45
 
Data Science Course Certificate by Sigma Software University
Stepan Kalika
 
Using AI/ML for Space Biology Research.pdf
VICTOR MAESTRE RAMIREZ
 
05_Jelle Baats_Tekst.pptx_AI_Barometer_Release_Event
FinTech Belgium
 
Feb 2021 Ransomware Recovery presentation.pptx
enginsayin1
 
Technical-Report-GPS_GIS_RS-for-MSF-finalv2.pdf
KPycho
 
How to Add Columns and Rows in an R Data Frame
subhashenia
 
Business implication of Artificial Intelligence.pdf
VishalChugh12
 
apidays Singapore 2025 - Trustworthy Generative AI: The Role of Observability...
apidays
 
SQL for Accountants and Finance Managers
ysmaelreyes
 
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
Research Methodology Overview Introduction
ayeshagul29594
 
UNISE-Operation-Procedure-InDHIS2trainng
ahmedabduselam23
 
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
NIS2 Compliance for MSPs: Roadmap, Benefits & Cybersecurity Trends (2025 Guide)
GRC Kompas
 
Ad

Replacing gtag.js with walker.js

  • 1. Markus Baersch Replacing gtag.js with walker.js Why? How? Demo: Running GA4 Using ssGTM
  • 3. Why Not GTAG.JS? (yes, same old song - but only a very brief summary. And a new color! Yay!)
  • 4. gtag.js some issues (shortened version) Source: likely to be blocked Heavy: UA, GA4, GAds, Optimize, partner badges + stuff Not a “Stream To Rule Them All”: no data without consent. Consent Mode is not an option!
  • 5. gtag.js … is odd! (also shortened version) GA4 Session Handling & More: ● “first_visit” and “session_start” ● Conversions ● referral exclusion ● public measurement id
  • 6. Options: ● ga4mp.dev by David Vallejo (-> ssGTM) ● Build your own format and send to own endpoint Or use existing tools like CDPs, Tealium (see slides from MC Berlin 2022) But: ● Blocking might still be a problem ● Costs? ● Control? Alternatives exist! perfect fit?
  • 7. Feeding GA4 with walker.js
  • 8. Open source: walker.js is a maintained repo on GitHub (Can) have all data you need: there are timestamps, timings, hit numbers… https://github.com/elbwalker/walker.js elbwalker open source event tracker
  • 9. Tagging Basics uses a command / event queue called “elbLayer” (per default) scans DOM for data-elb attributes and builds events and parameters alternatively push events to elbLayer manually via JavaScript can send events to several destinations Destinations are consent sensitive (walker.js can handle consent) https://github.com/elbwalker/sgtm-client-template/tree/main/example
  • 10. events have an “open” structure to contain default attributes, custom attributes, session state, user information, references… or whatever Send example: elb('page view', {id: '/test/virtual/path1', title: 'Virtual Page 1'}, 'click', {some_property: 14} ); Events
  • 11. Sending Stuff: walker.js Destinations Every destination can handle events individually. We use it to send data to a ssGTM endpoint
  • 12. GA4 Session Handling GA4 wants session handling (simple) example… - is only active if consent is present - uses localStorage / sessionStorage - which is only possible on a single domain AND host - Can be part of destination init block (see example code for ssGTM tag) elb("walker user", {hash: sD.sessionId, device: sD.clientId});
  • 13. Tagging: GTM Tag Template github.com/elbwalker/gtm-tag-template Custom Templates for walker,js Configuration and walker,js Events to migrate GTM setups - destinations - GA4 session data - ecom item conversion - use your existing variables
  • 14. Endpoints ● use ssGTM and translate walker events to ssGTM event model ○ trigger / fire any tags as if gtag.js did generate all requests ● or build your own in Node, PHP or whatever and forward events to GA4 ○ cloud edge endpoints actually are an option ;) ● Remember: CNAME is not an option to avoid browser tracking protection issues
  • 15. ssGTM Example use custom client for walker events basic example and client template available on Github: github.com/elbwalker/ sgtm-client-template -> fork and build what you need (contribute if you like!)
  • 16. send data to GA4 using standard tag enrich server-side dimensions add debug flag for better debugging (kill before publishing ;)) ssGTM Example
  • 17. … or send data (additionally or exclusively) to Piwik PRO, Matomo… … or send directly to BigQuery as event-level raw data ssGTM Example
  • 18. Demo sending events… … from client-side GTM… -> to ssGTM -> to GA4 Medium article: mbaersch.medium.com/ A-better-solution-for-ga4- Data-capturing-replacing- gtag-js-with-walker-js- 2b9fd291d919
  • 19. No ssGTM? Use: worker for walker events forward (few data) to GA4 using GAMP V2 think: add event to D1 cloud database ;) Or build your endpoint as - AWS Lambda - GCP Cloud Function - Azure Function Cloud Functions & Workers
  • 20. Can you see it?
  • 22. Game On! download and play: Walker | GTM Tags | Client | BQ: github.com/elbwalker Order: markus-baersch.de/gtmbook