How to Set Up and Track Custom Events in Google Analytics 4

Create and track custom events in GA4 using Google Tag Manager or GA4’s built-in tools to measure key user actions and improve marketing decisions.

Why This Matters

Custom events help you track key user interactions on your site—like add to cart, begin checkout, or view a pricing page—so you can:
✅ Improve funnel visibility
✅ Optimize ad targeting
✅ Report on critical business goals

Before You Start

You must have:

  • Google Tag Manager installed 
  • Google Analytics 4 installed 

Choose one of the two methods below:

  • Use Google Tag Manager for flexible, scalable tracking 
  • Use GA4 directly for basic event needs with minimal setup 

When To Do This

  • After GA4 + GTM are installed 
  • Once meaningful site traffic exists 
  • Anytime you want to track new site behaviors 

Who Does This

  • Marketing Manager 
  • Business Owner 
  • Analytics Specialist 

How To Track Custom Events Using Google Tag Manager

Step 1: Create a New Tag

  1. Go to Google Tag Manager 
  2. Click Tags → New 
  3. Under Tag Configuration, choose Google Analytics: GA4 Event 
  4. Input your GA4 Measurement ID 
  5. Name your event (e.g., add_to_cart, view_pricing) 
  6. Set event parameters as needed (e.g., page URL, button text) 

Step 2: Set a Trigger

Option A: Page View Trigger

  1. Under Triggering, create a new Page View trigger 
  2. Use Regex Matching to accurately target specific URLs 
  3. Example RegEx: 

bash

CopyEdit

(http|https):\/\/(www\.)?yourdomain\.com\/thank-you(?!\/.*\/)((\/?)$|.*.*=.*)

 

Option B: Click Trigger

  1. Go to Variables → Configure, enable all Click variables 
  2. Go to Triggers → New → Click: All Elements 
  3. Set to fire on specific clicks (e.g., Click Text = “ADD TO CART”) 
  4. Use Preview mode to identify which variable (Click ID, Class, or Text) applies 
  5. Link this trigger to the event tag you created earlier 

Step 3: Save & Publish

✅ Save the tag and trigger
✅ Click Submit → Publish
Add a version name and description for documentation

How To Track Events Directly in Google Analytics 4

Step 1: Create an Event in GA4

  1. Go to Google Analytics 
  2. Click Admin → Events → Create Event 
  3. Set a custom event name (e.g., begin_checkout) 
  4. Add matching conditions:
    • event_name = page_view 
    • page_location contains /checkout 
  5. Click Create 

Step 2: Mark as Conversion (Optional)

  1. Return to Events dashboard 
  2. Toggle your custom event to mark as conversion if it’s a key action 

Verify & Maintain Events in GA4

Use DebugView to Test

  1. Install GA Debugger Chrome Extension 
  2. Turn it ON 
  3. Go to Configure → DebugView 
  4. Interact with your site to verify if events are firing in real time 

Edit or Delete Events

  1. Go to Admin → Events → Create Event 
  2. Click the event you want to modify 
  3. Edit or click the kebab menu to Delete 

Resources

Final Tips

✅ Always use naming conventions (e.g., GA_Event_AddToCart)
✅ Keep GTM organized with clear labels and folders
✅ Regularly test events using GA4 DebugView
✅ Limit conversions to meaningful actions only