How to Set an Event in Google Analytics

Cody Schneider

Tracking more than just pageviews is essential to truly understanding how users interact with your website. By setting up events in Google Analytics, you can measure specific actions like button clicks, form submissions, and video plays, giving you a much clearer picture of what’s working and what isn’t. This guide will walk you through exactly how to set up events in Google Analytics 4 with and without code, so you can start gathering deeper insights today.

What is a Google Analytics Event, Exactly?

In the simplest terms, a Google Analytics event is any specific user interaction on your website that can be measured independently of a page loading. While pageviews tell you what pages users are visiting, events tell you what they’re doing on those pages.

Think about all the important actions a user can take that don't involve loading a new page:

  • Clicking a "Request a Demo" button

  • Playing an embedded video

  • Downloading a PDF guide

  • Submitting a contact form

  • Scrolling 75% of the way down a long blog post

Each of these is a valuable interaction that you can - and should - track as an event. By doing so, you can move beyond simple traffic metrics and start to understand user engagement, measure conversion goals, and optimize your site for the actions that matter most to your business.

Events in GA4 vs. Universal Analytics: A Quick Explainer

Google has fundamentally changed how it thinks about data between its older version, Universal Analytics (UA), and the current version, Google Analytics 4. The approach to events is one of the biggest differences.

  • In Universal Analytics (UA), events were a distinct type of tracking hit, separate from pageviews. They had a rigid structure with three main components: Category (e.g., 'Videos'), Action (e.g., 'Play'), and Label (e.g., 'Homepage Product Demo').

  • In Google Analytics 4, nearly every interaction is considered an event. The old Category-Action-Label structure is gone. Instead, an event consists of an Event name (like contact_form_submit) and optional Parameters, which are additional pieces of data that provide context (like button_text: 'Send Message').

Because GA4 is the current standard, we'll focus most of our energy there. It's not only more flexible but also offers simpler, no-code methods for event creation.

How to Set Up Events in Google Analytics 4

In GA4, you have a powerful toolkit for tracking events, ranging from actions that Google tracks for you automatically to entirely custom events you define yourself. Let's break down the most practical methods.

Method 1: Creating Events Directly in the GA4 Interface (No Code Needed)

This is the easiest way to get started and is perfect for turning an existing interaction, like a page view or a click, into a new, more descriptive event. A classic use case is tracking a "Thank You" page visit as a form submission confirmation.

Imagine your contact form redirects users to yourwebsite.com/thank-you upon successful submission. Here’s how you’d create a generate_lead event for that:

Step 1: Navigate to the Events SectionIn your GA4 property, click on Admin in the bottom-left corner. Then, under the Data display column, click on Events.

Step 2: Start Creating a New EventOn the Events page, click the blue Create event button. Then, on the next screen, click Create again.

Step 3: Configure Your Custom EventThis is where you define your new event and the conditions that will trigger it. For our "Thank You" page example, you would fill it out as follows:

  • Custom event name: Enter your new event name here. It's best to use Google's recommended event names when possible. For a lead, we'll use generate_lead.

  • Matching Conditions: This tells GA4 when to log your new event.

    • In the first row, set the Parameter to event_name, the Operator to equals, and the Value to page_view. We’re telling GA4 to look for any page view.

    • Click Add condition.

    • In the second row, set the Parameter to page_location, the Operator to contains, and the Value to /thank-you. This narrows it down to pageviews of your confirmation page.

Now, any time a user views a page with /thank-you in the URL, GA4 will not only record a page_view event but also create and record your new, more meaningful generate_lead event.

You can use this method for other things too, like creating an ebook_download event based on a click event where the link_url parameter contains the path to your PDF.

Method 2: Using Google Tag Manager (for Power and Flexibility)

While the GA4 interface is great for simple event creation, Google Tag Manager (GTM) is the powerhouse for custom tracking. It allows you to track nearly any interaction on your site without having to ask a developer to write code. It’s the recommended approach for most marketers.

Let's walk through a common example: tracking a click on a specific "Contact Us" button.

First, a quick refresher on GTM's core concepts:

  • Tags: The actual tracking code that sends data to a platform like Google Analytics. In this case, it will be a GA4 Event tag.

  • Triggers: The rules that tell a tag when to fire. For our example, the trigger will be a user clicking our specific "Contact Us" button.

  • Variables: Placeholders for values that can change, like a page's URL or the text of a clicked button. They provide information to both tags and triggers.

Step 1: Enable Click Variables in GTM

To identify the specific button being clicked, we need access to built-in click variables.

  1. In your GTM container, navigate to Variables in the left-hand menu.

  2. Underneath the "Built-In Variables" section, click Configure.

  3. Scroll down to the "Clicks" section and make sure all the boxes are checked, especially Click Text, Click Classes, and Click ID. This gives us more options for identifying the element we want to track.

Step 2: Create a Trigger

Now we'll create the rule that fires only when a user clicks our target button.

  1. Go to Triggers in the left-hand menu and click New.

  2. Give your trigger a descriptive name, like "Click - Contact Us Button".

  3. Click inside the Trigger Configuration box and choose the trigger type All Elements under the "Click" section.

  4. Under This trigger fires on, select Some Clicks.

  5. Now, set the conditions to fire the trigger. You'll want to find a unique identifier for your button. Look for one of these options (usually available if you right-click the button on your site and select "Inspect"):

  • If your button has unique text: Set the condition to Click Text - equals - Contact Us.

  • If it has a unique CSS ID: Use Click ID - equals - contact-button. This is the most reliable method.

  • If it has a unique CSS class: Use Click Classes - contains - btn-primary-contact.

  1. Click Save.

Step 3: Create the GA4 Event Tag

Next, we create the tag that sends the event data to GA4 when the trigger fires.

  1. Go to Tags in the GTM menu and click New.

  2. Name your tag something like "GA4 Event - Contact Button Click".

  3. Click in the Tag Configuration box and select Google Analytics: GA4 Event.

  4. For the Configuration Tag, select your main GA4 configuration tag (the one you set up to load GA4 on all pages).

  5. In the Event Name field, enter a name that will appear in your GA4 reports, such as contact_us_click. Stick to lowercase letters and underscores.

  6. (Optional but Recommended) Under Event Parameters, you can add more context. For example:

    • Row 1 > Parameter name: button_text | Value: {{Click Text}}

Step 4: Attach the Trigger and Publish

The final step is to connect our trigger to our tag.

  1. Below the Tag Configuration box, click inside the Triggering box.

  2. Select the trigger you created in Step 2 ("Click - Contact Us Button").

  3. Click Save.

  4. Finally, use the Preview mode in the top right to test your setup on your site. Once you confirm the tag fires correctly, click Submit to publish your changes.

Verifying That Your Events Are Working

So you've set up your brand new event - how do you make sure it's actually recording data? The best way to test in real-time is by using GA4's DebugView.

  1. In GTM's Preview mode, perform the action you set up to be tracked (e.g., click the contact button).

  2. In a separate tab, go to your GA4 property and navigate to Admin > DebugView.

  3. You should see your event (e.g., contact_us_click) appear in the timeline within seconds.

Note that new events may take up to 24-48 hours to appear in your standard GA4 reports on the Events page, but DebugView gives you instant confirmation that your setup works.

Bonus Tip: Turn Event Parameters into Custom Dimensions

If you set up an event parameter in GTM (like our button_text example), you won't be able to see that data in your standard GA4 reports by default. To make it usable, you need to register it as a "custom dimension."

  1. Go to GA4 Admin > Custom definitions.

  2. Click Create custom dimensions.

  3. Fill in the fields:

  • Dimension name: Button Text (This is how it will appear in your reports).

  • Scope: Event.

  • Event parameter: button_text (This must match the parameter name you set in GTM exactly).

  1. Click Save.

After about 24 hours, you'll be able to use "Button Text" as a dimension in your reports, allowing you to see which specific button text is driving your contact_us_click events.

Final Thoughts

Setting up events is a foundational step in transforming Google Analytics from a simple traffic counter into a powerful tool for understanding user behavior. Whether you use the straightforward no-code GA4 interface for simple tasks or the powerful flexibility of Google Tag Manager for more detailed tracking, the goal is the same: to collect data that helps you make better decisions.

Of course, collecting event data is just the beginning. Analyzing that data alongside performance metrics from your ad platforms, sales from your CRM, and revenue from your e-commerce store is often where the real challenge lies. Instead of spending hours manually piecing together these different data sets, we built Graphed to connect all your data sources in one place. You can instantly create real-time dashboards and reports by asking simple questions in plain English, turning your raw event data into clear, actionable insights in seconds.