How to Set Up Google Analytics 4 Events in GTM

Cody Schneider8 min read

Setting up custom event tracking in Google Analytics 4 is one of the most powerful ways to understand what users are actually doing on your website, but getting started can feel overwhelming. This guide is here to change that. We'll walk you through exactly how to set up, test, and launch custom GA4 events using Google Tag Manager (GTM), step by step, making the whole process simple and clear.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Why Use Google Tag Manager for GA4 Events?

Before jumping into the "how," it's helpful to understand the "why." While you can use the standard GA4 interface to track some events, using Google Tag Manager gives you far more power and flexibility. Think of GTM as a toolbox that allows you to manage all the different tracking scripts and marketing tags on your site from one central place, without having to constantly bother your developers to add code.

Here are the biggest advantages of using GTM for GA4:

  • No Code Required: Once GTM is installed on your site, you can set up dozens of different event tags without ever having to touch your website's codebase again. This is a game-changer for marketers and analysts.
  • Powerful Testing Tools: GTM's built-in "Preview Mode" is an essential feature that lets you test your tags thoroughly on your live site (without affecting real users) before you publish them. You can't do that with the standard GA4 interface alone.
  • Centralized Management: GTM acts as a single dashboard for all your tracking tags - not just GA4, but also Meta Pixel, Google Ads conversion tags, and more. This keeps your setup organized and manageable.
  • Version Control: Every time you publish a new set of changes in GTM, it creates a new version. If you ever make a mistake, you can quickly roll back to a previous version, providing a crucial safety net.

Understanding GTM's Core Building Blocks: Tags, Triggers, and Variables

To use Google Tag Manager effectively, you need to understand three fundamental components. Every single thing you do in GTM will involve some combination of these three elements.

Tags

A Tag is a snippet of code that you want to execute on your website. In our case, the tag will be a "Google Analytics: GA4 Event" tag. The tag's job is to send specific data to a platform like Google Analytics. You can have tags for Facebook conversions, Google Ads tracking, LinkedIn insights, etc.

  • What it does: The "worker bee." It's the piece of code that actually performs an action, like sending event information to GA4.
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Triggers

A Trigger tells a tag when to fire. A tag won't do anything until a specific condition you've defined is met. This condition could be anything from a user visiting a specific page to them clicking a particular button or submitting a form.

  • What it does: The "manager." It listens for certain user interactions on your website and tells the tags when it's time to spring into action.

Variables

A Variable is a piece of information that can be used in both tags and triggers. For example, a variable could be the text of a button a user clicks on ("Click Text"), the URL of the page they are on ("Page URL"), or the ID of the form they submitted ("Form ID"). GTM has many useful built-in variables you can enable, and you can also create your own custom variables.

  • What it does: The "information carrier." It holds dynamic values that make your tags and triggers smarter and more specific.

In short: When a condition defined by a Trigger happens, it fires a Tag, which can then use Variables to send specific data to your analytics platform.

Step-by-Step: Setting Up Your First Custom GA4 Event in GTM

Let's walk through a tangible, real-world example: tracking clicks on a "Request a Demo" button. This is a crucial conversion action for many SaaS and service-based businesses, and it's something GA4 won't track by default.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 1: Get the Foundation Right (The GA4 Configuration Tag)

Before you can send any event data, you need to establish a connection between GTM and your Google Analytics 4 property. This is done with the GA4 Configuration Tag, which needs to fire on every single page of your website.

If you haven't done this yet, here’s how:

  1. In GTM, go to Tags > New.
  2. Name your tag something clear, like "GA4 - Configuration - All Pages."
  3. Under "Tag Configuration," select Google Analytics: GA4 Configuration.
  4. In the "Measurement ID" field, enter the Measurement ID from your GA4 property. You can find this in GA4 under Admin > Data Streams > [Your Stream]. It starts with "G-".
  5. Under "Triggering," select the All Pages trigger. This ensures GTM loads GA4 on every page.
  6. Click Save.

This tag serves as the main pipeline for all your GA4 data. You only need to set it up once.

Step 2: Enable Built-In Click Variables

Next, we need to give GTM the tools to identify the specific button we want to track. The easiest way to do this is by enabling GTM's built-in click variables.

  1. In GTM, go to the Variables section on the left-hand menu.
  2. Under the "Built-In Variables" section, click Configure.
  3. A list of variables will pop up. Scroll down to the "Clicks" section and check the boxes next to Click Text, Click Classes, and Click ID.

This simple action makes these valuable pieces of information available for us to use when creating our trigger.

Step 3: Create the Trigger

Now, let's create the rule that tells GTM when to fire our event tag. We want it to fire only when a user clicks on our "Request a Demo" button.

  1. Go to Triggers > New.
  2. Name your trigger something descriptive, like "Click - Button - Request a Demo."
  3. Under "Trigger Configuration," choose a trigger type. For tracking links or buttons, select Just Links under the "Click" section.
  4. Leave "Wait for Tags" and "Check Validation" as they are for this example.
  5. This is the most important part: tell the trigger to fire on Some Link Clicks.
  6. Now, define the condition. For the dropdowns, select: Click Text | contains | Request a Demo
  7. Click Save.

We’re telling GTM: "Only fire when someone clicks on an element where the text includes 'Request a Demo'." Using "contains" is often safer than "equals" because it allows for variations or accidental extra spaces.

Step 4: Create the GA4 Event Tag

With our trigger ready, we can now create the tag that will send the event data to GA4.

  1. Go to Tags > New.
  2. Name your tag "GA4 - Event - request_demo_click." It's best practice to use snake_case (lowercase with underscores) for GA4 event names.
  3. Under "Tag Configuration," select Google Analytics: GA4 Event.
  4. In the "Configuration Tag" dropdown, select the GA4 Configuration tag you created in Step 1.
  5. For "Event Name," type in request_demo_click. This is exactly how the event will appear in your GA4 reports.
  6. Now, we link the tag to the trigger. Under "Triggering," select the trigger you just created: "Click - Button - Request a Demo."
  7. Click Save.

Don't Fly Blind: How to Test and Verify with Preview Mode

THIS IS THE MOST IMPORTANT STEP! Never, ever publish your GTM changes without testing them first. GTM's Preview Mode is an amazing tool that lets you see exactly what's firing on your site in real-time.

  1. In the top right corner of your GTM workspace, click the Preview button.
  2. A new tab will open, asking for your website's URL. Enter it and click Connect.
  3. Your website will open in a new tab with a "Tag Assistant Connected" badge in the corner. Go back to the Tag Assistant tab.
  4. In the Tag Assistant summary, you'll see a section for "Tags Fired" and "Tags Not Fired." At this point, your new "request_demo_click" tag should be under "Tags Not Fired," which is correct!
  5. Now, go to your website tab and perform the action you want to track: click your "Request a Demo" button.
  6. Go back to the Tag Assistant tab. In the left-hand rail, you should see a "Link Click" event appear. Click on it.
  7. You should now see your "GA4 - Event - request_demo_click" tag has moved to the "Tags Fired" section. Success! This means your trigger condition was met and your tag worked as expected.

For a final confirmation, open your GA4 property and go to Admin > DebugView. Perform the button click again, and you should see the request_demo_click event appear in the real-time debug stream. This confirms that the data is arriving safely in Google Analytics.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Publish Your Changes

Once you've confirmed everything works perfectly in Preview Mode, it's time to set it live for all your users. Back in GTM, click the blue Submit button in the top right. Give your version a descriptive name (e.g., "Added Request a Demo Button Event") and click Publish.

That's it! Your event tracking is now live.

Final Thoughts

By following this guide, you now have the fundamental knowledge to track virtually any user interaction on your site using an organized, scalable GTM setup. From button clicks to form submissions, you can capture the specific data points that illustrate how users engage with your business, giving you much deeper insights than GA4's default reports ever could.

Now that you have this rich event data flowing into Google Analytics, the ultimate goal is to turn it into answers. Instead of falling into the trap of manually exporting CSVs and wrestling with spreadsheets to see which button clicks lead to which outcomes, we built Graphed to automate that entire process. Just connect your Google Analytics account, and you can simply ask, "show me a breakdown of request_demo_click events by landing page for last month," and get an instant, real-time dashboard without the headache of manual reporting.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!