How to Add Event to Google Analytics
Tracking what visitors do on your website goes way beyond just counting pageviews. To truly understand user behavior, you need to track specific actions - like button clicks, form submissions, and video plays - using events. This article will show you exactly how to set up event tracking in Google Analytics 4, covering both the straightforward in-platform method and the more powerful approach using Google Tag Manager.
What Exactly Are Events in Google Analytics 4?
If you used the older version of Google Analytics (Universal Analytics), you might remember tracking events using Category, Action, and Label fields. GA4 simplifies this with a flexible, event-based model where every user interaction is captured as an event.
This streamlined approach means everything from a page_view to a purchase is treated as the same type of hit, just with a different name. This makes reporting more consistent and powerful. GA4 groups events into four main types:
- Automatically collected events: These are the base events GA4 tracks by default as soon as you install the tracking code. You don't have to do anything to set them up. Examples include
session_start(when a user starts a session),first_visit(a user's first time on your site), andscroll(when a user scrolls 90% of the page). - Enhanced measurement events: With a simple toggle in your GA4 admin settings, you can enable a set of more advanced automatic events. These include useful interactions like
click(for outbound link clicks),file_download,video_progress, andform_submit. - Recommended events: Google provides a list of suggested event names for common scenarios across different industries (e.g., e-commerce, gaming, travel). For example, they recommend using
add_to_cartandbegin_checkoutfor online stores. While not mandatory, using these standard names can unlock future reporting features and ensure consistency. - Custom events: This is where you get full control. A custom event is any event you name and implement yourself. If you want to track something specific that doesn’t fit into the other categories - like a "Request a Demo" button click or a newsletter sign-up - you'll create a custom event.
Track Actions, Not Just Pageviews
Pageview data tells you where your users are going, but it doesn't tell you what they are doing. Relying on pageviews alone is like watching people walk into different rooms of a building but having no idea what they're doing inside each room.
Events fill in this critical gap. They allow you to measure the micro-conversions and key interactions that lead to your ultimate business goals. Think about the actions on your website that signal interest or intent:
- Submitting a contact form
- Clicking your main call-to-action button
- Downloading a whitepaper or PDF case study
- Watching an embedded product demo video
- Clicking an affiliate link
- Signing up for a free trial
None of these are pageviews (though some might lead to a "Thank You" page), but they are often far more valuable indicators of a successful visitor session. By tracking them as events, you can start answering important business questions like, "Which marketing channel drives the most demo requests?" or "How many visitors from our blog downloaded the latest e-book?"
Free PDF Guide
AI for Data Analysis Crash Course
Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.
Method 1: Creating Events Directly in the GA4 Interface
The simplest way to create a new event is directly within the GA4 admin panel. This method works well when you want to create a new, more specific event based on an existing event that’s already being tracked. It’s perfect for simple use cases, like turning a visit to a specific URL into a dedicated conversion event.
Let's walk through a common example: creating a dedicated generate_lead event whenever someone lands on your "thank-you" page after submitting a form.
Step 1: Navigate to the Events Section
Login to your Google Analytics 4 property. In the bottom-left corner, click on Admin (the gear icon). In the Property column, find and click on Events.
Step 2: Start Creating a New Event
On the Events page, you'll see a list of all events currently being collected. In the top-right corner, click the blue Create event button.
Step 3: Define Your New Event's Logic
Here you'll set up the rules for your new event.
- Custom event name: Give your new event a clear, descriptive name. Stick to snake_case (all lowercase with underscores instead of spaces). For our example, let's use
generate_lead. - Matching Conditions: This is where you tell GA4 when to trigger your new event.
When you're finished, your configuration should essentially say: "When a page_view event occurs AND the page_location contains /contact/thank-you, create a NEW event called generate_lead."
Step 4: Save Your Event
Click Create in the top-right corner. That's it! Your new event will now be logged whenever a user visits the "thank-you" page.
Method 2: Using Google Tag Manager for Maximum Flexibility
While the GA4 interface method is easy, it’s limited. What if you want to track a button click that doesn't lead to a new page? For that and countless other scenarios, Google Tag Manager (GTM) is the answer. GTM gives you granular control to track virtually any interaction on your website.
GTM can seem intimidating at first, but it operates on three core components:
- Tags: The actual tracking code that sends data to a platform like Google Analytics. For this task, we’ll use the
Google Analytics: GA4 Eventtag. - Triggers: These are the rules that tell your tags when to fire. A trigger could be a page view, a button click, a form submission, or a custom event.
- Variables: These are placeholders for values that can change, like a URL, the text on a button, or order total.
Let's walk through setting up a custom event to track every time a user clicks your "Request a Demo" button.
Step 1: Enable Click Variables
By default, GTM doesn't track all the details about clicks. You need to enable them first.
- In your GTM container, go to Variables in the left sidebar.
- In the Built-In Variables section, click Configure.
- Scroll down to the Clicks section and check the boxes for
Click Classes,Click ID,Click Target,Click URL, andClick Text. This makes data about each click available for you to use in your triggers.
Step 2: Create a New Trigger
Next, we need to create a rule that fires only when someone clicks the specific "Request a Demo" button.
- Go to Triggers and click the New button.
- Give your trigger a name, like "Click - Request a Demo Button".
- Click inside the Trigger Configuration box and choose the trigger type All Elements under the Click section.
- Set the trigger to fire on Some Clicks.
- Now define the condition that isolates your button. Choose one of the variables you just enabled from the first dropdown. A good, reliable choice is
Click IDif your button has a unique ID, orClick Textif the button text is unique. Let's useClick Text. - Set the firing conditions to:
Click TextequalsRequest a Demo. - Click Save.
Pro Tip: Using Click ID or a unique CSS Click Class is generally more robust than Click Text, as text can easily change. Ask your developer to add a unique ID to important buttons you want to track!
Step 3: Create the GA4 Event Tag
Now it's time to connect the trigger to a tag that will send the event data to GA4.
- Go to Tags and click New.
- Name your tag something clear, like "GA4 Event - Request Demo".
- Click inside the Tag Configuration box and select Google Analytics: GA4 Event.
- From the Configuration Tag dropdown, select your main GA4 configuration tag (you should have already set this up when installing GTM).
- In the Event Name field, enter the name for your event. Let's use
request_demo. - Below this, click on the dropdown for Event Parameters if you want to send more context. For example, you could add a parameter named
button_textand set its value to the{{Click Text}}variable. This would send the exact button text along with the event. - Now, move down to the Triggering section and click on it.
- Select the trigger you just created, "Click - Request a Demo Button".
- Click Save.
Free PDF Guide
AI for Data Analysis Crash Course
Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.
Step 4: Preview, Test, and Publish
Never publish your changes without testing! GTM has a fantastic built-in preview mode for this.
- In the top right of GTM, click Preview.
- Enter your website URL and click Connect. A new tab with your website will open, and you'll see a GTM Debugger panel connected to it.
- On your website, click the "Request a Demo" button.
- Go back to the GTM Tag Assistant tab. In the summary on the left, you should see a "Click" event. Click on it, and you should see that your "GA4 Event - Request Demo" tag fired successfully.
- For final confirmation, go to your GA4 account and navigate to Admin > DebugView. You should see your
request_demoevent appear in the timeline within seconds.
Once you’ve confirmed everything is working, go back to GTM, click Submit, give your version a name, and press Publish. Your new event tracking is now live!
How to Mark Your Events as Conversions
Tracking an event is great, but the most important ones should be marked as conversions. This allows GA4 to feature them in key reports and makes the data available for attribution and bidding in platforms like Google Ads.
It's incredibly simple to do:
- Go to Admin > Events in your GA4 property.
- Find your newly created custom event in the list (e.g.,
generate_leadorrequest_demo). It can sometimes take 24 hours to appear here for the first time. - On the right side of the row, simply click the toggle switch to enable Mark as conversion.
Just like that, your key user action is now officially tracked as a business goal.
Final Thoughts
Mastering event tracking is the key to unlocking meaningful, actionable insights from Google Analytics. By moving beyond simple pageviews and measuring key interactions with custom events via the GA4 interface or the more powerful Google Tag Manager, you gain a clear view of what’s truly driving your business goals.
Setting up tracking is the first step, but the real work starts when you try to turn all that raw event data into clear reports. We know the pain of manually piecing together dashboards just to answer questions like "which channels drove the most valuable conversions this month?" At your favorite analytics tool, we've built Graphed to connect directly to your data sources like Google Analytics, allowing you to ask questions in plain English and get stunning dashboards and reports instantly. It's like having a data analyst on your team, turning your newly tracked events into actionable insights in seconds, not hours.
Related Articles
Facebook Ads for Home Cleaners: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for home cleaners in 2026. Discover the best ad formats, targeting strategies, and budgeting tips to generate more leads.
Facebook Ads for Pet Grooming: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for pet grooming businesses in 2025. Discover AI-powered creative scaling, pain point discovery strategies, and the new customer offer that works.
AI Marketing Apps: The 15 Best Tools to Scale Your Marketing in 2026
Discover the 15 best AI marketing apps in 2026, from content creation to workflow automation, organized by category with pricing and use cases.