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
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
- GA4's enhanced measurement logs a click event for links that leave your domain, but you must register link_url as a custom dimension to see which link was clicked.
- Cloaked links on your own domain, like /go/ or /recommends/, are not outbound to GA4; track them with a Tag Manager event.
- GA4 misses visitors who block it or decline consent, so its click counts are a sample, not a total.
- GA4 can't see affiliate sales; to connect clicks to commission you need a click ID in the network's sub-ID.
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:
| Parameter | Example value |
|---|---|
link_url | https://www.awin1.com/cread.php?awinmid=1234... |
link_domain | www.awin1.com |
link_id | The link's HTML id, if it has one |
link_classes | The link's CSS classes |
outbound | true |
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.
Step 1: make link URLs visible
- In GA4, go to Admin, then Data display, then Custom definitions.
- Create a custom dimension: scope Event, event parameter
link_url, name it "Link URL". - 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.
Step 2: a report that answers "which link on which page"
In Explore, start a free-form exploration:
- Dimensions: Page path and screen class, Link URL, Event name.
- Metric: Event count (and Total users if you want unique clickers).
- Filter: Event name exactly matches
click. - Rows: Page path first, then Link URL.
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.
Step 3: cloaked links on your own domain
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:
- Enable the built-in Click URL and Click Text variables.
- Create a trigger: type Click, Just Links, fire on some link clicks, where Click URL contains
/go/(use your own prefix). - Create a GA4 Event tag named
affiliate_clickwith parameterslink_url={{Click URL}}andlink_text={{Click Text}}. - Register
link_textas a custom dimension if you want to compare buttons. - 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
- Enhanced measurement is off for outbound clicks in the web stream settings. Check Admin, Data streams, your stream, Enhanced measurement.
- The "link" isn't a link. Buttons that navigate with JavaScript, or links injected by a widget inside an iframe, don't trigger the outbound event. Use a plain
<a href>. - You're looking too soon. Standard reports can lag by a day. Use Realtime or DebugView to confirm events fire.
- Your own visits are filtered. An internal traffic filter that excludes your IP hides your test clicks from reports, though DebugView still shows them.
- Consent banner settings stop GA4 from sending events until the visitor accepts.
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
| Gap | Why | What fills it |
|---|---|---|
| Commission per click | The sale happens on the merchant's site and is reported to the network, not to you | A click ID in the network's sub-ID, returned by postback or report |
| Complete click counts | Ad blockers, browser privacy features and declined consent stop GA4 from loading | Counting at the redirect, which doesn't depend on page scripts |
| Clicks outside your site | GA4 only sees your pages | Tracking links in email, video descriptions and social bios |
| Bots | GA4 filters known bots but doesn't show you what it filtered | A 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