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).
- Click the “Configure” tab then select “Events”.
- 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.
- To create a new event when someone visits a page, click “Create event”.
- In the next screen, click “Create” .
- 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.
-
-
- Matching conditions:
- 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”.
- Matching conditions:
- You should then see the new event created. Click the exit button to return to the events dashboard.
- The next time someone visits any of your checkout pages, it’ll be recorded in the event dashboard.
- If you wish to track this event as one of the conversions or goals, you can mark it as a conversion.
- 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.
- That’s it! You’ve now configured a new event in Google Analytics.
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).
- Click the “Configure” tab then select “Events”.
- Click “Create event”.
- Click on the event that you’ve created previously.
- Edit the event parameters accordingly and click “Save”.
- That’s it. You’ve now successfully edited your event.
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).
- Click the “Configure” tab then select “Events”.
- Click “Create event”.
- Click on the event that you’ve created previously.
- In the top right corner, click on the kebab menu and select “Delete”.
- Your event will then be deleted and you’ll be redirected to the create events page.
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.
- Next, login to your Google Analytics account.
- Head to the “Configure” tab and select “DebugView”.
- In DebugView, you will be able to see all the events tracked in real time in Google Analytics 4.
- 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.
- If the lead tracking is successful, you should see the custom event tracked in DebugView.