Don't have one? Create one ↗
← All courses

Lesson 1 of 4

GA4 Config + Event

① Connect your GTM container

Paste your container ID to load it into this page. It only ever runs here.

Advanced: use a specific environment

GA4 in GTM is two tags working together. One base tag (the Google tag) loads GA4 on the page exactly once and carries your Measurement ID. From then on, each thing you want to measure is a separate GA4 Event tag that fires on its own trigger and sends just that event by name.

The button below pushes a sign_up event with a method of google or email. Your job is the base tag that loads GA4 plus a GA4 Event tag that catches sign_up and forwards the method along with it, so you can see in GA4 how people signed up.

Goal

Load GA4 with a base tag, then fire a GA4 Event tag for sign_up that maps the method parameter.

Build it in GTM

  1. Store the Measurement ID in a Constant

    Go to Variables, and under User-Defined Variables click New and choose Constant. Paste your GA4 Measurement ID (it looks like G-XXXXXXXXXX), name it GA4 Measurement ID and Save. Now the base tag and every event tag can reference {{GA4 Measurement ID}} instead of hard-coding the ID, so they always agree.
  2. Build the GA4 base tag (Google tag)

    Go to Tags → New and choose Google Tag. In the Tag ID field, reference your {{GA4 Measurement ID}} constant. Set it to fire on Initialization - All Pages so GA4 loads once, early, before any event tags. Name it something clear like Google Tag - GA4 and Save.
  3. Create the Custom Event trigger for sign_up

    Go to Triggers → New and choose Custom Event. In Event name type sign_up, it must match the pushed string exactly, including the underscore. This trigger fires whenever the page pushes that event.
  4. Fire a GA4 Event tag that maps method

    Create a GA4 Event tag, point its Measurement ID at {{GA4 Measurement ID}}, and set Event Name to sign_up. Under Event Parameters, add a parameter named method with value {{DLV - method}} (a Data Layer Variable reading method). Fire it on your sign_up trigger. For practice you can substitute a Custom HTML tag named Custom HTML - Test with <script></script>, but the GA4 Event tag is the real-site choice.

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.

  1. In your GTM, click Preview.
  2. Paste the live URL above and click Connect.
  3. Interact with the live page and watch your tag fire in Tag Assistant.

What you should expect to see

Click Google or Email on the live page. In Tag Assistant a sign_up event appears in the left rail, your GA4 Event tag shows under Tags Fired, and the outgoing hit carries method set to the option you picked.

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

0 of 4 lessons complete