Tracking link clicks helps you understand what visitors do after arriving on your website. You can measure clicks on buttons, phone numbers, email addresses, downloads, affiliate links, social media links and links leading to other websites.
Google Analytics 4, commonly called GA4, can automatically track some link clicks. For more specific tracking, you can use Google Tag Manager to create a custom event.
This guide explains both methods step by step.
Before You Begin
You should already have the following set up:
- A Google Analytics 4 property.
- A web data stream connected to your website.
- The Google Analytics tag installed on your website.
- Access to edit your Google Analytics property.
For custom tracking, you will also need Google Tag Manager installed on your website.
Method One: Automatically Track Outbound Link Clicks
An outbound link takes a visitor from your website to a different domain.
Examples include:
- A link to your Facebook page
- An affiliate product link
- A link to a partner’s website
- A link to an external booking platform
- A link to a Google review page
GA4 can automatically track outbound links through Enhanced Measurement. You do not need to add special code to each link.
Step 1: Open Your GA4 Property
Sign in to Google Analytics and select the property connected to your website.
Make sure you are working in the correct property before changing any settings.
Step 2: Open the Data Stream
Click Admin in the lower-left corner.
Under Data collection and modification, select Data streams.
Click the web data stream connected to your website.
Step 3: Turn On Enhanced Measurement
Find the section called Enhanced measurement.
Make sure the main Enhanced Measurement switch is turned on.
Click the gear icon beside Enhanced Measurement to view its individual tracking options.
Make sure Outbound clicks is enabled, and then save your settings. Google states that Enhanced Measurement begins sending supported events without requiring changes to your website’s code.
Step 4: Test an External Link
Open your website in another browser tab.
Click a link that sends you to a different domain. For example, click a link from your website to Facebook, Google or another external website.
GA4 records outbound clicks using an event named:
click
The event may include information such as:
- The complete link URL
- The destination domain
- The page where the click occurred
- The text associated with the link
- Whether the click was outbound
Links leading to domains configured as part of cross-domain measurement may not be treated as outbound clicks.
Step 5: View Outbound Link Clicks
To create a useful outbound-link report:
- Open Explore in Google Analytics.
- Select the blank exploration template.
- Add the dimensions Link URL, Link domain and Outbound.
- Add Event count as a metric.
- Place Link URL or Link domain under Rows.
- Place Event count under Values.
- Add a filter where the event name equals
clickor where Outbound equals true.
This report will show which external links received clicks and how many clicks each link received. Google’s official outbound-click tutorial recommends using an exploration with Link URL, Link domain, Outbound and Event count.
Creating a Separate Event for One Specific Outbound Link
The automatic click event collects all outbound clicks together. You may want a separate event for an especially important link.
For example, suppose your website contains a button that leads to a financing application. You could create an event named:
financing_link_click
Step 1: Open the Events Settings
In GA4, click Admin.
Under Data display, select Events.
Click Create event, followed by Create.
You generally need Editor-level access or higher to create an event from another event.
Step 2: Name the New Event
Enter a descriptive custom event name, such as:
financing_link_click
Use lowercase letters and underscores instead of spaces.
Other useful event names could include:
google_review_clickaffiliate_link_clickfacebook_link_clickbooking_link_clickcontact_email_click
Avoid creating a different event name for every individual page or minor link. Event parameters can be used to provide those details.
Step 3: Add the Matching Conditions
Create the following matching conditions:
event_nameequalsclicklink_urlcontains the important part of the destination URL
For example:
- Parameter:
event_name - Operator: equals
- Value:
click
Then add:
- Parameter:
link_url - Operator: contains
- Value:
example.com/application
Using “contains” is often safer than entering the entire URL because the destination may include tracking parameters or other minor changes.
Leave Copy parameters from the source event enabled. This allows the new event to retain useful information from the original click event. GA4 can generate a new event whenever an existing event matches the conditions you provide.
Click Create when finished.
The new event only applies to clicks collected after it has been created. It does not normally reorganize historical data.
Method Two: Track a Specific Link with Google Tag Manager
Enhanced Measurement is convenient, but it is mainly designed for outbound links. Google Tag Manager provides more control when you need to track:
- Internal links
- Menu links
- Download buttons
- Phone-number links
- Email links
- Buttons without a normal external destination
- Links with specific text, classes or IDs
- One particular call-to-action button
Google’s standard Tag Manager process is to create a GA4 Event tag and connect it to a click trigger.
Step 1: Enable Click Variables
Open your Google Tag Manager container.
Select Variables from the left menu.
Under Built-In Variables, click Configure.
Enable the click variables you may need, including:
- Click URL
- Click Text
- Click Classes
- Click ID
- Click Element
- Click Target
These variables allow Tag Manager to identify what a visitor clicked.
Step 2: Create a Click Trigger
Open Triggers and click New.
Give the trigger a descriptive name, such as:
Click - Financing Application Link
Click Trigger Configuration.
Choose Just Links when tracking a normal HTML link. Choose All Elements when tracking a button or another clickable element that is not a traditional link.
Select Some Link Clicks or Some Clicks.
Create a condition that identifies the correct link.
For example:
Click URL contains example.com/application
You could also use:
Click Text equals Apply Now
A URL, element ID or unique CSS class is normally more dependable than Click Text because visible button wording may change.
Google’s documentation also provides an example where a trigger fires when Click Text contains a particular button label.
Step 3: Create the GA4 Event Tag
Open Tags and click New.
Name the tag something descriptive, such as:
GA4 Event - Financing Link Click
Select Google Analytics: GA4 Event as the tag type.
Enter or select the Google Analytics Measurement ID connected to your website.
Enter an event name such as:
financing_link_click
Google recommends configuring the GA4 Event tag with a Measurement ID and an event name, then connecting it to a trigger that determines when the event is sent.
Step 4: Add Event Parameters
Event parameters give you more information about each click.
Useful parameters include:
link_urlwith the value{{Click URL}}link_textwith the value{{Click Text}}link_classeswith the value{{Click Classes}}page_locationwith the value{{Page URL}}page_titlewith the value{{Page Title}}
These parameters let you use one event name while still seeing which link was clicked and where the click happened.
Be careful not to send personally identifiable information, such as names, email addresses or phone numbers, to Google Analytics.
Step 5: Attach the Trigger
Click the Triggering section at the bottom of the event tag.
Select the click trigger you created earlier.
Save the tag.
Step 6: Test the Event
Click Preview in Google Tag Manager.
Enter your website address and click Connect.
Your website will open with Tag Assistant connected.
Click the link you want to track.
Return to Tag Assistant and confirm that the GA4 Event tag appears under Tags Fired for the click.
If it appears under Tags Not Fired, inspect the click variables and adjust your trigger conditions.
Google recommends testing new tags with Tag Manager’s Preview mode before publishing the container.
Step 7: Check GA4 Realtime or DebugView
Open Google Analytics.
Go to Reports, followed by Realtime, or open Admin and select DebugView.
Click the tracked link again.
Look for the event name you created, such as:
financing_link_click
Open the event to inspect its parameters.
Seeing the event in Tag Assistant confirms that the Tag Manager trigger worked. Seeing it in GA4 confirms that the event was successfully received by Google Analytics.
Step 8: Publish the Tag Manager Container
Once the event works correctly, return to Google Tag Manager.
Click Submit.
Select Publish and Create Version.
Enter a version name and description, such as:
Added financing link click tracking
Click Publish.
Your event will not track normal website visitors until the updated container has been published.
Marking the Link Click as a Key Event
A key event is an action that is especially valuable to your business. It was previously called a conversion in Google Analytics.
You might mark a link click as a key event when it represents:
- Starting an application
- Clicking a booking button
- Contacting your business
- Requesting a quote
- Opening a checkout page
- Visiting an important partner platform
In GA4, open Admin and select Events under Data display.
Find the custom event and enable Mark as key event.
Do not mark every link click as a key event. Reserve this setting for actions that represent meaningful progress toward an important business result.
Common Tracking Problems
The Event Does Not Appear Immediately
Realtime and DebugView are normally the best places to test new events. Standard reports may take longer to process and display the data.
The Trigger Fires on Too Many Links
Your trigger condition may be too broad.
Instead of using:
Click URL contains application
Use a more specific condition such as:
Click URL contains example.com/financing/application
The Link Opens Before the Event Is Sent
Use Tag Manager’s Just Links trigger and test the setup carefully. Some links navigate so quickly that tracking requests may not finish, especially when the page uses unusual JavaScript behaviour.
The Button Does Not Have a Click URL
The element may be a JavaScript button rather than a normal link. Use an All Elements click trigger and identify it through Click ID, Click Classes, Click Text or a CSS selector.
The Event Works in Preview but Not for Visitors
The Tag Manager container may not have been published. Return to Tag Manager and check whether the latest workspace changes are live.
Outbound Clicks Are Missing
Confirm that Enhanced Measurement and outbound-click tracking are enabled. Also check whether the destination domain has been added to cross-domain measurement, since those domains are not treated as outbound destinations.
Recommended Setup
For general external-link reporting, use GA4 Enhanced Measurement.
For one particularly important outbound link, create a new GA4 event from the automatic click event.
For internal links, buttons, downloads, telephone links or highly specific tracking requirements, use Google Tag Manager.
A clear setup might use the following event names:
contact_link_clickphone_link_clickemail_link_clickapplication_link_clickdownload_clickbooking_link_click
Keep event names consistent, test everything before publishing and use parameters to provide details about each click. A properly configured link-click event will show not only how many people visit your website, but also which calls to action successfully capture their attention.