GA4 outbound link tracking for affiliate links: what it counts, what it misses, how to fix it

November 28, 2026 · Hoplytic team · 5 min read

The short version: this guide in 71 seconds.
Read the video transcript

How do you see affiliate clicks in GA four? It already records them, but hides them.

Turn on Outbound clicks in enhanced measurement. Register the link URL parameter as an event-scoped custom dimension. Then build an exploration with page path, link URL and event count.

Cloaked links on your own domain aren't counted as outbound, because to GA four they're internal.

Create a link click trigger where the click URL contains your prefix, like slash go. Add a GA four event tag with the link URL and link text. Then confirm the event in DebugView.

GA four can't show commission, because the sale is reported to the network. A click ID in the sub-ID fills that gap. Ad blockers and declined consent hide clicks. Counting at the redirect doesn't depend on page scripts.

Hoplytic's site script reads UTM codes and ad click I Ds from the landing page. It stores them with each click, along with the page and spot, so you can report commission by UTM campaign.

The full guide is right below. Hoplytic: ad tracking made simple.

Key points

Google Analytics 4 already sees most of your affiliate clicks. The trouble is that it hides them: no default report says "this link on this page was clicked 212 times". A few settings fix that, and a short list of gaps tells you where GA4 stops being the right tool.

Short answer: turn on Outbound clicks in enhanced measurement, then register the link_url event parameter as an event-scoped custom dimension. Build an exploration with page path, link URL and event count. For cloaked links on your own domain (like /go/desk), add a Google Tag Manager event, because GA4 doesn't treat them as outbound.

What GA4 records out of the box

With enhanced measurement on (it is on by default in new web streams), GA4 logs an event named click each time someone clicks a link that leads to a different domain. Google's documentation lists these parameters with it:

ParameterExample value
link_urlhttps://www.awin1.com/cread.php?awinmid=1234...
link_domainwww.awin1.com
link_idThe link's HTML id, if it has one
link_classesThe link's CSS classes
outboundtrue

Links to domains in your cross-domain list don't count as outbound. Check the current list of parameters in Google's enhanced measurement help page; it changes from time to time.

  1. In GA4, go to Admin, then Data display, then Custom definitions.
  2. Create a custom dimension: scope Event, event parameter link_url, name it "Link URL".
  3. Optionally do the same for link_domain, so you can group by network or merchant.

The new dimension only fills from now on. Older clicks stay without it.

In Explore, start a free-form exploration:

Now you can read: /best-standing-desks sent 212 clicks to Awin and 40 to Amazon this month. Divide by that page's views to get a click-through rate per post, which tells you which posts persuade and which just get read.

Most WordPress affiliates use links like yoursite.com/go/desk. To GA4 that's an internal link, so no outbound click event fires. The fix in Google Tag Manager:

  1. Enable the built-in Click URL and Click Text variables.
  2. Create a trigger: type Click, Just Links, fire on some link clicks, where Click URL contains /go/ (use your own prefix).
  3. Create a GA4 Event tag named affiliate_click with parameters link_url = {{Click URL}} and link_text = {{Click Text}}.
  4. Register link_text as a custom dimension if you want to compare buttons.
  5. Preview in Tag Assistant, click a link, and confirm the event in GA4's DebugView.

Use the same event name for outbound links too if you prefer a single report: set the trigger to fire on your cloaked prefix and on known network domains.

A link on a separate subdomain such as go.yoursite.com may or may not register as outbound, depending on your settings. Don't assume; check it in DebugView.

When clicks don't show up

Optional: make affiliate clicks a key event

Marking affiliate_click as a key event lets you see "clicks to merchants" next to traffic sources and campaigns. That's useful for comparing channels: did the newsletter or Pinterest send people who went on to click? It is still a click, not a sale, so don't optimize ad spend on it alone.

What GA4 can't do for affiliates

GapWhyWhat fills it
Commission per clickThe sale happens on the merchant's site and is reported to the network, not to youA click ID in the network's sub-ID, returned by postback or report
Complete click countsAd blockers, browser privacy features and declined consent stop GA4 from loadingCounting at the redirect, which doesn't depend on page scripts
Clicks outside your siteGA4 only sees your pagesTracking links in email, video descriptions and social bios
BotsGA4 filters known bots but doesn't show you what it filteredA tool that labels bot clicks with a reason

Sending sales into GA4 is possible in theory with the Measurement Protocol, but you need the visitor's GA client ID to travel through the affiliate link and come back with the sale. Most networks have no field for that beyond the sub-ID you are probably already using.

Because of these gaps, expect GA4 and a redirect-based tracker to disagree on click totals. Why the numbers differ, and by how much is normal, is covered in tracker and network numbers don't match.

Using GA4 and a tracker together

A setup many publishers settle on: GA4 for traffic (which channels bring readers, which pages they read), a tracker for money (which click earned which commission). Keep UTM tags on links into your site, as in UTM parameters and affiliate links, and let the tracker carry those values onto the affiliate click. Hoplytic's site script does that: it reads UTM and ad click IDs from the landing page and stores them with each click, along with the page and spot, so you can report commission by utm_campaign without GA4 ever seeing a sale.

Questions people ask

Where do I see outbound clicks in GA4?

Under Reports, Engagement, Events, open the click event. To see which URLs were clicked, first register link_url as an event-scoped custom dimension, then add it in an exploration or a customized report.

Why does GA4 show no data for my new custom dimension?

Custom dimensions only fill from the moment you create them; they don't apply to older data. Standard reports can also take a day or more to process.

Can GA4 track affiliate sales?

Not by itself, because the purchase happens on the merchant's site. You would have to send each sale into GA4 yourself, which needs the visitor's GA client ID passed through the affiliate link and back, and few networks support that.

Does GA4 count clicks on links to my own subdomain?

It depends on your setup and cross-domain settings. Test it: click the link with DebugView open and see whether a click event with outbound set to true appears.

More in Tracking fundamentals

Also: tracking glossary · ad platform macros · Markdown copy