How to Set Up Custom Events in Google Analytics 4
Tracking specific user actions on your website is fundamental to understanding what’s working and what isn’t. With Google Analytics 4, you can move beyond simple page views and a few automatic interactions by setting up custom events. This article will show you two primary methods for creating custom events in GA4: a simple approach directly within the GA4 interface and a more powerful, flexible method using Google Tag Manager.
What Are Events in GA4, Anyway?
In the universal analytics of old, tracking was based on sessions and pageviews. In GA4, everything is an event. A user loading a page is a page_view event. Someone starting a session is a session_start event. This event-based model is more flexible and provides a more accurate picture of how users interact with your site or app.
GA4 categorizes these events into four distinct types:
- Automatically Collected Events: These are the base-level events GA4 tracks by default when you install the tracking code. Think of things like
session_start,first_visit, andpage_view. You don't have to do anything to enable them. - Enhanced Measurement Events: These are a step up, tracking more specific interactions like scrolls (
scroll), outbound link clicks (click), site search (view_search_results), and file downloads (file_download). You can toggle these on or off within your GA4 Data Stream settings. - Recommended Events: Google provides a list of predefined event names for common scenarios across different industries. Using these recommended names, like
login,sign_up, orpurchase, allows GA4 to better understand your data and unlock certain standard reporting features. - Custom Events: This is where you get to define what's important for your business. A custom event is any event you name and implement yourself because it’s not covered by the other types. This could be anything from a specific button click, a video play, or a newsletter signup form submission.
Custom events are your superpower for gathering tailored behavioral data that directly relates to your business goals.
Before You Start: A Quick Planning Session
Jumping straight into creating events without a plan is a recipe for chaos. Before you open a single dashboard, take five minutes to map out exactly what you need to track. A simple measurement plan avoids creating redundant or poorly named events that will confuse you later.
For each interaction you want to track, define the following:
- The User Action: What exactly is the user doing? Be specific. Instead of "form submit," say "Submitted the contact us form."
- The Event Name: This is what will appear in your GA4 reports. Follow Google's recommended naming convention: use snake_case (lowercase words separated by underscores). For our example, a good name would be
contact_form_submit. - Associated Parameters (Optional): Parameters are extra pieces of information you send along with an event. For our
contact_form_submitevent, you might want to include the page the form was on (e.g.,page_location) or a form ID (e.g.,form_id: 'contact_page').
A simple plan saves countless hours of cleanup down the road.
Method 1: Creating Events in the GA4 Interface
The simplest way to create a new event is directly inside GA4. This method doesn't track new interactions like a button click, rather, it lets you create a new, more specific event based on an existing event that GA4 already collects.
This is perfect for situations where a user landing on a certain page signifies a key action. A classic example is tracking a lead generation action when someone lands on your "thank you" page after filling out a form.
Let's create a custom generate_lead event for this scenario.
Step 1: Navigate to the Events Section
Go to your GA4 property and click on Admin in the bottom-left corner. Next, under the Data display column, click on Events.
Step 2: Create a New Event
On the Events page, click the blue Create event button. This will take you to the Custom events builder. Click Create again.
Step 3: Configure Your Custom Event
You'll see a configuration panel. Here’s what to fill out:
- Custom event name: Enter the name you decided on during your planning phase. We will use
generate_lead. - Matching Conditions: This is where you define the criteria for your new event. GA4 will scan all incoming events, and when one matches these conditions, it will fire your new custom event. For our "thank you" page example, we'll set two conditions:
These rules tell GA4, "When a page_view event happens on a URL that contains /thank-you, also create a new event called generate_lead."
Step 4: Save and Wait
Click Create in the top right. That's it! Your new event is now active. It may take up to 24 hours to start appearing in your standard reports, but you can verify it's working immediately using GA4's DebugView.
Method 2: Using Google Tag Manager (GTM) for True Customization
For tracking specific in-page interactions like button clicks, video plays, or form submissions that don't have a unique "thank you" page, Google Tag Manager is the tool you need. It provides granular control over what you track and when. It might seem intimidating, but the process is quite logical.
Let's walk through a common example: tracking clicks on a "Download Ebook" button.
Every tag in GTM consists of three parts:
- Variables: Information GTM needs to evaluate rules (e.g., the text of a clicked button).
- Triggers: The rules that tell a tag when to fire (e.g., "fire when a button with the text 'Download Ebook' is clicked").
- Tags: The actual piece of code that does something, like sending an event to GA4.
Step 1: Enable Click Variables
First, we need to tell GTM to pay attention to click-related details.
- In your GTM container, go to Variables from the left menu.
- Under Built-In Variables, click Configure.
- Scroll down to the Clicks section and check the boxes for variables like Click Classes, Click ID, and Click Text. This makes them available for use in our trigger.
Step 2: Create the Trigger
Next, we create the rule that identifies our specific button click.
- Go to Triggers and click New.
- Give your trigger a descriptive name, like "Click - Download Ebook Button."
- Click inside the Trigger Configuration box and select All Elements under the Click section.
- Select Some Clicks. This reveals the conditions for firing.
- Now, set the condition to isolate your button. You have several options, but finding the most unique identifier is best:
- Save the trigger.
Step 3: Create the GA4 Event Tag
Now we create the tag that sends the event data to GA4 when the trigger fires.
- Go to Tags and click New.
- Name your tag something clear, like "GA4 Event - Ebook Download."
- Click into Tag Configuration and select Google Analytics: GA4 Event.
- For the Configuration Tag, select your main GA4 configuration tag (you should already have this set up).
- In the Event Name field, enter the custom event name from your plan, like
ebook_download. - (Optional but Recommended) Open the Event Parameters dropdown to add more context. Click Add row. Let's add the text of the button clicked:
Step 4: Attach the Trigger to the Tag
Below the Tag Configuration, click into the Triggering box. Select the trigger you just created ("Click - Download Ebook Button"). Now your tag knows what to do (send a GA4 event) and when to do it (when the ebook button is clicked).
Step 5: Preview, Test, and Publish
Never publish without testing!
- In the top right of GTM, click Preview.
- Enter your website URL and click Connect. A new tab of your website will open with the GTM debugger connected.
- On your website, perform the action: click the "Download Ebook" button.
- Go back to the GTM debugger window. In the left-hand summary, you should see a "Click" event. Click on it.
- Check the "Tags Fired" section. You should see your "GA4 Event - Ebook Download" tag there. This confirms your trigger and tag are working correctly.
- For final confirmation, open your GA4 property and navigate to Admin > DebugView. You should see the incoming
ebook_downloadevent appear in the timeline. - Once you are confident everything's working, return to GTM and click Submit, then Publish to push your changes live.
Final Step: Register Your Custom Parameters
One critical step often overlooked: if you sent any custom parameters with your event (like our button_text parameter), GA4 will collect them, but they won't be usable in your reports until you register them.
- Go back to GA4 Admin.
- Under Data display, click Custom definitions.
- Click the Create custom dimensions button.
- Give your dimension a name (e.g., "Button Text").
- For Scope, select Event.
- For the Event parameter, enter the exact parameter name you used in GTM:
button_text. The name must be identical. - Click Save.
After 24-48 hours, this new custom dimension will be available in your GA4 explorations and other reports, letting you segment your data by the parameters you've collected.
Final Thoughts
Setting up custom events is the key to unlocking meaningful, business-specific insights from Google Analytics 4. Whether you use the simple in-platform event creation for page-based conversions or the powerful flexibility of GTM for specific user interactions, taking the time to track what matters will transform your data from a vanity metric into an actionable tool for growth.
Once you are collecting this valuable event data, the next challenge is making sense of it all. We built Graphed to connect directly to sources like Google Analytics, so you can stop wrestling with custom reports and instead just ask for what you need. You can use simple language like, "Show me a chart of ebook_downloads and contact_form_submits over the last 30 days," and instantly get the visualization you need, helping you act on your insights faster.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?