Skip to content
English
  • There are no suggestions because the search field is empty.

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

  1. Login to your Google Analytics account.
  2. Make sure you’ve selected the right property (the website that you’ve implemented the Google Analytics 4 tracking code).

3. Click the “Configure” tab then select “Events”.

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.

5. To create a new event when someone visits a page, click “Create event”.

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.
Matching conditions:
      1. Set event_name — equals — page_view
      2. 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”.

8. You should then see the new event created. Click the exit button to return to the events dashboard.

9. The next time someone visits any of your checkout pages, it’ll be recorded in the event dashboard.

10. 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

  1. Make sure you’re logged in to your Google Analytics account.
  2. Select the right property (the website that you’ve implemented the Google Analytics 4 tracking code).
3. Click the “Configure” tab then select “Events”.

4. Click “Create event”.

5. Click on the event that you’ve created previously.

6. Edit the event parameters accordingly and click “Save”.

7. That’s it. You’ve now successfully edited your event.

How to delete an event in Google Analytics 4

  1. Make sure you’re logged in to your Google Analytics account.
  2. Select the right property (the website that you’ve implemented the Google Analytics 4 tracking code).
3. Click the “Configure” tab then select “Events”.

4. Click “Create event”.

5. Click on the event that you’ve created previously.

6. In the top right corner, click on the kebab menu and select “Delete”.

7. Your event will then be deleted and you’ll be redirected to the create events page.

Verify your event setup inside Google Analytics

  1. 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.
  2. Once you’ve downloaded the extension, click on the plugin and make sure it is ON.
3. Next, login to your Google Analytics account.
4. Head to the “Configure” tab and select “DebugView”.

5. In DebugView, you will be able to see all the events tracked in real time in Google Analytics 4.
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.