SOP 168: How to Set Up And Track Custom Events In Google Analytics 4
Goal:
Create a new tracking event when a user visits a key page on your website.
Ideal Outcome:
Successfully create a custom event when a user visits a key page on your website (e.g. checkout page).
Prerequisites or requirements:
You need to have an existing Google Analytics 4 account.
Why this is important:
Tracking how users interact with your site gives you insights about their behaviors which allows you to create reports and funnel analysis to improve your business.
Where this is done:
Google Analytics 4.
When is this done:
After you’ve set up Google Analytics 4 on your site and have generated traffic for a period of time.
Who does this:
The marketing manager, business owner or the person responsible for managing web analytics
Set up a new event in Google Analytics 4
- Login to your Google Analytics account.
- Make sure you’ve selected the right property (the website that you’ve implemented the Google Analytics 4 tracking code).
4. You will see a list of events that occurred in the time period.
Note: Google Analytics automatically records user interaction events by default (e.g. session_start, scroll, etc). The events will only show once it’s occurred. To view the full list of events that Google Analytics 4 collects, visit the official documentation.
6. In the next screen, click “Create” .
7. In the event configuration page, set the following details:
Custom event name — This event name should describe the action a user does on this page. For example, “begin_checkout” if the user is on the checkout page. It’s recommended that you follow Google’s guidelines on event names.Other event examples to track:
- add_payment_info ➝ When a user submits their payment info.
- add_to_cart ➝ When a user adds items to cart.
- view_cart ➝ When a user views their cart.
- tutorial_complete ➝ When a user completes a tutorial.
-
-
- Set event_name — equals — page_view
- Set page_location — contains — [insert_page_url]Important: In this SOP we’re using checkout page as an example, assuming the checkout page url contains “/checkout”. You should replace “/checkout” with the URL you want to track on your site. Once you’ve completed the event configuration, click “Create”.
-
Note: You should only mark this event as a conversion if it’s an action that you consider is important, such as purchase, checkout completion, or form submission.
How to edit an event in Google Analytics 4
- Make sure you’re logged in to your Google Analytics account.
- Select the right property (the website that you’ve implemented the Google Analytics 4 tracking code).
How to delete an event in Google Analytics 4
- Make sure you’re logged in to your Google Analytics account.
- Select the right property (the website that you’ve implemented the Google Analytics 4 tracking code).
Verify your event setup inside Google Analytics
- In order to verify in real time if the lead tracking is working, we will utilize Google Analytics 4 DebugView. First, go ahead and install the GA Debugger Chrome Extension.
- Once you’ve downloaded the extension, click on the plugin and make sure it is ON.
4. Head to the “Configure” tab and select “DebugView”.
6. Now we can begin to test if the custom event we’ve set up is working. Visit the web page where the custom event is tracked.
7. If the lead tracking is successful, you should see the custom event tracked in DebugView.