How to Track Events in Google Analytics
Tracking page views only tells you half the story of what visitors are doing on your site. The real insights come from understanding the specific actions visitors take - like clicking a "Request a Demo" button, playing a product video, or downloading a case study. This guide walks you through several ways to track these meaningful interactions as events in Google Analytics 4, from simple no-code setups to more advanced and flexible methods.
What Are Events in Google Analytics 4?
If you're used to Universal Analytics, you'll remember its rigid event structure: Category, Action, and Label. GA4 throws that out the window for a much more flexible, event-based model. In GA4, nearly every interaction is an event, from loading a page (page_view) to completing a purchase (purchase).
This new model gives you the freedom to define and track the exact interactions that matter to your business. Events in GA4 fall into four main categories, and understanding them is the first step to mastering tracking:
- Automatically collected events: These are tracked by default when you install GA4. They include basic interactions like
session_start(when a user begins a new session) andfirst_visit(when a user visits for the first time). You don't have to do anything to enable these. - Enhanced measurement events: These are also automatic, but you can turn them on or off. They track common website interactions like scrolls, outbound link clicks, video views, and file downloads. We'll look at how to check these settings next.
- Recommended events: Google provides a list of suggested event names for common scenarios across different industries (like
add_to_cartfor e-commerce orloginfor any site with user accounts). Using these recommended names helps GA4 understand your data better and makes your reporting more consistent. - Custom events: This is a custom event you name and implement yourself. It's the most flexible option and is perfect for capturing actions unique to your website, like a form submission for a specific newsletter or clicks on a particular marketing call-to-action.
First, Check Your Enhanced Measurement Settings
Before you dive into creating custom events, it's worth checking if GA4 is already tracking what you need through Enhanced Measurement. You might be surprised by what’s enabled by default.
Here’s how to check and configure your settings:
- Navigate to the Admin section of GA4 (the gear icon in the bottom-left).
- Under the Property column, click on Data Streams.
- Select the appropriate web data stream for your website.
- Under the Events section, you'll see a heading for Enhanced measurement. Make sure the toggle is on.
- Click the gear icon on the right to see which specific events are being tracked.
From here, you can enable or disable tracking for these common interactions:
- Page views: Tracks each time a page loads or the browser history state changes.
- Scrolls: Fires an event when a user scrolls 90% of the way down a page.
- Outbound clicks: Captures when a user clicks a link that leads them away from your domain.
- Site search: Tracks searches made using your website's internal search function.
- Video engagement: Records when users start, complete, and watch embedded YouTube videos on your site.
- Form interactions: Tracks a form submission for the first time in a session. Note: this one can be a bit unpredictable, so manual form tracking is often more reliable.
- File downloads: Automatically logs an event when a user clicks a link to a common file type (e.g., PDF, DOCX, XLSX, MP3, etc.).
If the action you want to track is on this list, just make sure it's enabled and you're good to go! If not, it's time to create a custom event.
How to Create a Custom Event in the GA4 Interface (No Code!)
One of the handiest features in GA4 is the ability to create new events based on existing ones directly within the interface - no code changes required. This is perfect for tracking actions like visiting a specific "thank you" page after a form submission.
Let's walk through an example. Imagine you want to create an event called quote_form_submitted that fires every time someone lands on your confirmation page, yoursite.com/thank-you-quote.
- Go to Admin → Events (under Data display).
- Click the Create event button. On the next screen, click Create again.
- A configuration panel will appear. First, give your new event a name. Following GA4's naming convention, we'll use snake_case:
- Next, define the "Matching Conditions." This tells GA4 when to trigger your new event. Since a confirmation page view is our trigger, we'll create conditions based on GA4’s default
page_viewevent. - Your configuration should now tell GA4: "When an event named
page_viewoccurs on a page where the URL contains/thank-you-quote, also create a new event calledquote_form_submitted." - Leave the "Copy parameters" box checked and click Create in the top right.
And that's it! Your event is now active. It may take up to 24 hours to appear in standard reports, but you can usually verify it’s working within minutes by checking the Realtime report in GA4 while you test it on your website.
Using Google Tag Manager for More Advanced Event Tracking
The GA4 interface method is great for page-based goals, but what if you want to track something that doesn't have a unique URL, like a click on a specific "Buy Now" button? For that, Google Tag Manager (GTM) is your best friend. It offers much more power and flexibility.
If you haven't used it before, GTM works using three core components:
- Tags: Snippets of code that send data to a third-party platform (like Google Analytics). A "GA4 Event Tag" is what we'll use.
- Triggers: The conditions that tell your tags when to fire. For example, "fire when someone clicks this specific button."
- Variables: Placeholders for values that can change, like a clicked link's URL (
Click URL) or the text of a button (Click Text).
Example: Tracking Clicks on a "Request a Demo" Button
Let's say you have a primary "Request a Demo" button on your home page, and it's essential to track how many people click it. Here's how to set that up with GTM.
Step 1: Enable the Correct Built-In Variables
Before creating the trigger, you need to make sure GTM is listening for clicks and can identify attributes of those clicks.
- In GTM, go to Variables in the left sidebar.
- Under Built-In Variables, click Configure.
- Scroll down to the Clicks section and check the boxes for Click Text and Click ID. This allows you to create triggers based on the text of an element or its unique CSS ID.
Step 2: Create the Trigger
The trigger will tell your tag to fire only when your specific demo button is clicked.
- Go to Triggers and click New.
- Give the trigger a descriptive name, like "Click - Request Demo Button."
- Click on Trigger Configuration and choose All Elements under the Click section.
- Change the trigger to fire on Some Clicks.
- Now, set the condition. If your button has unique text, you can use:
Click Text- equals -Request a Demo. (Tip: If you have multiple buttons with that text, a more precise way is to give your button a unique CSS ID in your HTML, likeid="header-demo-button", and use the conditionClick ID- equals -header-demo-button.) - Click Save.
Step 3: Create the GA4 Event Tag
Finally, you need to create the tag that sends the event data to GA4 when the trigger fires.
- Go to Tags and click New.
- Name the tag something clear, such as "GA4 Event - Demo Button Click."
- Click Tag Configuration and select Google Analytics: GA4 Event.
- Select your main GA4 Configuration Tag.
- In the Event Name field, enter the name you want to see in your GA4 reports, like
request_demo_click. - Now, click on Triggering and select the "Click - Request Demo Button" trigger you created in the last step.
- Click Save your tag.
Remember to click the Submit button in GTM to publish your changes live. You can use GTM's "Preview" mode to test your new tag and trigger in real-time before you push it live.
Best Practices for Naming and Organizing Your Events
As you start tracking more interactions, your list of custom events can get messy fast. Following a few best practices will save you major headaches in the future.
- Be Consistent: Stick to the recommended
snake_case_with_lowercaseformat for all your event names. It makes your data clean and easy to read. - Be Specific and Clear: Name events based on the action being performed.
contact_form_successis much clearer thanform_1_submit. Anyone on your team should be able to look at the event name and understand what it means. - Use Recommended Names First: Before creating a new custom event, check Google's list of recommended event names. If there’s a standard one that fits (like
sign_uporgenerate_lead), use it. - Map It Out: For complex tracking setups, create a simple spreadsheet to plan your events. List the event name, its trigger conditions, and any parameters you want to send along with it (like
button_textorform_id). This helps you maintain a coherent strategy instead of creating events on the fly.
Final Thoughts
Tracking custom events is the key to unlocking a deeper understanding of user behavior beyond simple page views. By setting up events in either GA4's interface or Google Tag Manager, you can measure the specific interactions that truly define user engagement and drive your business forward.
At Graphed, we believe that turning those carefully tracked events and all your other platform data into clear insights should be simple. Logging into GA4 to check event counts is one thing, but understanding how those custom events — alongside your ad spend from Facebook and revenue data from Shopify — contribute to your growth is another challenge. We make it easy to connect all your data sources and create real-time dashboards using plain English. Simply ask to see "how many demo_request_click events turned into customers in Salesforce last month" and an answer is ready in seconds, giving you back time to focus on strategy instead of report-building. Give Graphed a try and see how easy it can be to get holistic answers from all your data.
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!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.