Skip to Content
LLM Decode learn.llmdecode.com
Back to all resources
SOP-168

Set Up and Track Custom Events in Google Analytics 4

Successfully create a custom event when a user visits and clicks a key page on your website

Type SOPs · PDF
Execution time 20 Mins
Last updated 20 November 2024
Who does this The marketing manager, business owner or the person responsible for managing website analytics
Length 30 pages

Goal

Create a new tracking event when a user visits and clicks a key page on your website

Ideal outcome

Successfully create a custom event when a user visits and clicks a key page on your website (e.g. checkout page)

Why it matters

Tracking how users interact with your site gives you insights about their behaviors that allows you to create reports and funnel analysis to improve your marketing performance

Before you start

Some types of

Key steps 40 steps

What is inside 54 headings

1 Setting up Google Analytics 4 events using Google Tag Manager 6

  1. Go to Google Tag Manager and select the account you want to work on.
  2. In the sidebar, click "Tags" and "New".
  3. Under “Tag Configuration”, click “Choose a tag type to begin setup...”. From the dropdown list on your right, select “Google Analytics”.
  4. On the Google Analytics dropdown, input your measurement ID here:
  5. Next, under Event Name, click on the + button and click "Event".
  6. Now, depending on your goal, you can track page views or clicks.

2 Setting up Page View custom event 4

  1. Continuing from the above steps on your Google Tag Manager, scroll down to "Triggering" and click on the interlocking circle icon above "Choose a trigger to make this tag fire…". Click the + icon to add a new trigger:
  2. Select "All Pages".
  3. To add parameters that match the URL where we want our goal to fire, you will need to create RegEx (Regular Expression). Go back to "Tag configuration" > under "Event Name" > click "Event Parameters" > set the event parameter to "Page URL".
  4. Click the blue "Save" button at the top right side of your screen in the Tag configuration panel and that's it!

3 Setting up Click custom event 14

  1. Back in your Google Tag Manager workspace, click "Variables" and "Configure".
  2. Click "Triggers" and "New".
  3. Rename your trigger > Click the icon above "Choose a trigger to begin set-up..." > Select "Click: All Elements" > Select "All Clicks" > "Save".
  4. Now, you will need to find out which of the variables to use for what you want to track. To do that, open a new tab in the Google Tag Manager Overview and click “Preview” on the top right of the page.
  5. Enter the URL of your website and click "Start".
  6. This will open your website’s URL on a new tab. Navigate to the page where the button you want to track is. You should be able to see a message in the bottom right corner letting you know that the debugger has connected successfully.
  7. On your keyboard hold down the “Ctrl” (or “Cmd ⌘” key if you’re using a Mac) and click on the button that you want to track. Google Tag Assistant (Google Tag Assistant) will list all your actions.
  8. Google Tag Manager will list all the information that was returned from that click.
  9. Back in the tab when we left off during the set-up of a Click Event with a GA_Engagement_AddtoCart trigger, continue to click "Trigger Configuration" → Under "This trigger fires on", select "Some Clicks" > Select the combination you took when setting up a Click Event of this SOP > Hit "Save".
  10. Make a new "Tag" similar to when setting up Google Analytics Events using Google Tag Manager and rename it to "GA_Event_AddtoCart". Fill up the fields just like in the screenshot below:
  11. Scroll down and on the "Triggering" section > Click the icon above "Choose a trigger to make this tag fire…" > Select the trigger you have just created when setting up a Click Event of this SOP.
  12. Click the blue “Save” button on the top right corner, and that’s it! You’ve just created your trigger and added it to your tag, this event will now fire according to the conditions you have just set and send the values you configured.
  13. You are now ready to hit "Submit" of all the changes you’ve made.
  14. You will now be taken to see the summary of the changes you’ve just made.

4 Set up a new event directly in Google Analytics 4 7

  1. Login to your Google Analytics account.
  2. Ensure you’ve selected the right property (the website where you’ve implemented the Google Analytics 4 tracking code).
  3. Click “Admin” and then select “Events”.
  4. When someone visits a page, click “Create event” to create a new event.
  5. In the next screen, click “Create”.
  6. Once you’ve completed the event configuration, click “Create”.
  7. You should then see the new event created. Click the exit button to return to the events dashboard.

5 How to edit an event in Google Analytics 4 6

  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 and 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”.

6 How to delete an event in Google Analytics 4 6

  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 and 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 Verify your event setup inside Google Analytics 4 4

  1. In order to verify in real-time if the lead track 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, log in to your Google Analytics account.
  4. Head to the “Configure” tab and select “DebugView”.

The document 30 pages

The file is locked

It comes with the SOP Library.

Bought from LLM Decode before? Sign in to pay ₹ 1,999.00.

Up next · SOP-169 Set up form submission events in Google Analytics 4 via GTM Set up and track form submission events in Google Analytics 4 Unlock to read