Create event tracking for outbound links in Google Analytics 4 (GA4)

Google Analytics 4 (or GA4) allows you to track events (actions that occur by a user within the website) directly within the Google Analytics dashboard, without the need to write any custom Javascript code. This is great but, at least as of today (March 20th, 2023), I’ve found it’s a bit confusing to set up. It’s quite surprising to me that this isn’t something that’s set up by default but it turns out it’s not too hard to enable.

This guide will show you how to create an event that tracks any clicks that go to an outbound (external) URL. For example, if your website has a link that points to, you might want to know how many people are clicking that link.

Let’s get started…

Enhanced Measurement must be enabled

First, go to “Admin” for your Google Analytics 4 property by clicking the ‘gear’ icon at the bottom-left corner of your screen. Then click “Data Streams” within the “Property” column:

Select the appropriate “Data Stream” you wish to work with. In most cases, there will only be one.

Make sure that the toggle for “Enhanced measurement” is turned on.

Make sure that you have “Outbound clicks” selected — if you don’t see this then click the ‘gear’ icon to the right to add it.

Reports > Engagement > Events

Navigate to the “Events” screen as shown in the screenshot below. Here you’ll find “click” among the list of default Events.

One might think that clicking “click” would give you the details for all of the “click” events that occurred throughout the website but that doesn’t seem to be the case! There’s virtually no useful data about what links were clicked here! 🤔

Custom Definitions / Dimensions

It appears we can tell GA4 to provide this data to us by setting up “Custom Dimensions”.

Go to the “Admin” screen again by clicking the ‘gear’ icon at the bottom-left corner. Then click “Custom definitions” within the “Property” column.

Click the “Create custom dimensions” button and then enter the following settings:
Dimension name: Link_URL
Event parameter:

After clicking the “Save” button, you should begin to see the URLs of your outbound clicks within the “Events” screen (see above) within about 24 hours or so.


Another method is to create an “Exploration”.

A benefit of this method is that you’ll be able to immediately see all of the outbound click data from the past, and not just new data moving forward.

Go to the “Explore” screen in the left-sidebar. Then create a new “Blank” exploration.

Add two new Dimensions: “Event name” and “Link URL”.
You can find them both under the “Event” dropdown and “Link” dropdown respectively.

Add two new Metrics: “Event Count” and “Total Users”.
You can find them both under the “Event” dropdown and “User” dropdown respectively.

Add a new Row: “Link URL”.
You can simply click “Drop or select dimension” to select it.

Finally, add two new Values: “Event count” and “Total users”
You can simply click “Drop or select metric” to select these.

You should now see the right side of your screen populate with the URLs of the outbound links that have been clicked throughout your website!


You’ll likely notice that the first link_url row is empty. This occurs because the report you just created will show the event data for all links and not just the external / outbound links. You can remove this with the Filters section. Simply select the “Event name” dimension, set it to “exactly matches” and then enter “click”.

You can also filter out ‘javascirpt:void(0)’, ‘mailto:’, ‘tel:’, and any other unwanted URL clicks by simply creating a filter for each. For example, see the filter for ‘tel:’ below:

Lastly, you may want to change the default ’10’ rows to something a bit larger:

Voilà! Now you have event tracking enabled for outbound / external URL clicks in GA4, and you didn’t need to write any Javascript. Hopefully Google will improve upon this soon because that was certainly a lot of steps and I think tracking these types of clicks is something that should be baked in. I’ll update this post in the future if anything should change.