Lesson 1 of 7
Custom Event Basics
① Connect your GTM container
Paste your container ID to load it into this page. It only ever runs here.
Advanced: use a specific environment
Clicks, scrolls and page views are things GTM can see for itself. But "the newsletter signup actually succeeded" is something only your page knows. The way it tells GTM is a dataLayer push: a small line of code that announces an event by name.
You catch that announcement with a Custom Event trigger. The button below pushes { event: "newsletter_signup" }; your job is the trigger that listens for exactly that name and the tag that fires on it. This is the pattern behind nearly every meaningful conversion you'll ever track.
Goal
Build a Custom Event trigger for newsletter_signup and fire a tag on it.
Build it in GTM
Know what the page pushes
The site already runsdataLayer.push({ event: "newsletter_signup" })when the signup completes (on a real site your developer adds this line). GTM sees that as an event namednewsletter_signup.Create the Custom Event trigger
Go to Triggers → New and choose Custom Event. In Event name, typenewsletter_signup, it must match the pushed string exactly, including case and underscores.Fire a tag on it
Create your conversion tag (a GA4 Event tag namednewsletter_signupon a real site; here theCustom HTML - Teststand-in with<script></script>is fine) and set this trigger as its firing trigger.
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
newsletter_signup event appears in the left rail, and your tag shows under Tags Fired. No click before the push means no fire, the event is the signal.Verify your container
Built it? Export your container, Admin → Export Container, choose your workspace, then drop the JSON here to check it against this lesson.
Drop your container .json here
or browse · checked in your browser, nothing is uploaded