Lessons in this module
Lesson 18 of 20
Read A Server Hit
① Connect your GTM container
Paste your container ID to load it into this page. It only ever runs here.
Advanced: use a specific environment
Your collector received a hit in the last lesson. Now let's read one properly. A GA4 hit is a /g/collect request carrying one or more events, and every piece has an address: en is the event name, tid the measurement id, cid the client id, and every custom parameter travels as ep.name (or epn.name for numbers).
In a real server container, a GA4 client claims a request exactly when it recognizes this shape, then unpacks it into the event data object that server-side tags read. The Server view below does the same unpacking, so you can see both layers: the raw query string, and the clean object it becomes.
The three buttons push three distinct events with custom params. Your tags carry them to your collector; your job is to find each one's en, spot the ep.* params, and watch them land in the parsed object.
Goal
Send three named events through your tags and read each one's anatomy in the server view.
Build it in GTM
Keep your transport setting from the last lesson
Your Google tag'sserver_container_urlshould still point at your collector URL. Every GA4 hit for that measurement id routes through it, including event tags.One Custom Event trigger for all three
Triggers → New → Custom Event, event nameplan_selected|theme_changed|help_opened, and tick Use regex matching. One trigger, three events.One GA4 event tag that echoes the event name
Create a GA4 Event tag, set Event Name to{{Event}}(the built-in variable), and fire it on your new trigger. Bonus: add an event parameter likeplanmapped to a Data Layer Variable and find it in the hit asep.plan.Preview the live page and press all three buttons
Connect GTM Preview to the live URL, click each button, and watch the Server view: the newest hit is highlighted, expand it to compare the raw query with the parsed object.
Debug in Tag Assistant
Copy this lesson's live URL and paste it into GTM Preview, that is the page Tag Assistant connects to. It has the clickable elements, so this page stays clean for reading.
- In your GTM, click Preview.
- Paste the live URL above and click Connect.
- Interact with the live page and watch your tag fire in Tag Assistant.
What you should expect to see
en=plan_selected and params like ep.plan=pro and epn.seats=5; in the parsed object they become event and plain plan / seats keys.