Clickport
Start free trial

Outbound Links

Clickport automatically tracks every click on a link that leaves your site. No manual setup, no data attributes, no code changes. Just install the tracker and outbound link data appears on your dashboard.

How detection works

The tracker listens for all click events on the page using event delegation. When a visitor clicks an anchor element (<a>), the tracker compares the link's hostname against your site's hostname. If they differ, the click is recorded as an outbound event.

Both hostnames are normalized by stripping the www. prefix before comparison. This means www.example.com and example.com are treated as the same domain.

Auto-detection flow
What happens when a visitor clicks a link
1
Visitor clicks <a href="https://stripe.com/pricing">
2
Compare: stripe.com vs yoursite.com
3
Different hostname ➔ record outbound click event
4
Session flag has_clicked set, bounce recalculated

Data captured

For each outbound click, the tracker sends three pieces of data to the server:

The click is stored as an event with the name click in ClickHouse. The destination URL and link text are stored in the event's meta_keys/meta_values arrays as click_url and click_text.

Affiliate redirect detection

Some sites use internal redirect paths like /go/ to route visitors through an affiliate tracking page before sending them to the external destination. These links technically point to your own domain, so a simple hostname comparison would miss them.

Clickport handles this case. Any link pointing to /go/ or /go on your own domain is treated as an outbound click, even though the hostname matches. If the URL includes an asin query parameter, that value is captured as well.

Example: A link to https://yoursite.com/go/?asin=B09V3KXJPB is tracked as an outbound click with the ASIN B09V3KXJPB attached.

Amazon ASIN extraction

For links that point directly to Amazon (any domain containing "amazon"), the tracker attempts to extract the ASIN from the URL path. It looks for the pattern /dp/XXXXXXXXXX where the ASIN is a 10-character alphanumeric code.

This is useful for affiliate sites that link to Amazon products. The ASIN is stored alongside the click event and can be used as a goal condition for conversion tracking.

Where outbound links appear

Outbound click data appears in two places on your dashboard.

Outbound sub-tab

In the Content panel column, the Goals tab has an Outbound sub-tab. This shows all outbound link clicks grouped by destination domain. Each row displays the domain name, total clicks, and unique clicks (distinct sessions).

Pages Sessions Goals
Goals Outbound
Domain Clicks Unique
amazon.de 234 187
stripe.com 89 76
github.com 52 41
docs.google.com 18 15

The API endpoint GET /api/outbound-links returns up to 100 domains sorted by unique clicks. Each result includes an example URL and example link text from that domain.

Session timeline

When you expand a session in the Sessions panel, outbound clicks appear in the event timeline with a green indicator dot. The timeline shows the destination URL so you can see exactly where the visitor went.

Session timeline
Outbound clicks appear with a green dot
10:14:22
Pageview: /blog/best-headphones-2025
10:15:47
Scroll: 91%
10:16:03
Outbound click: amazon.de/dp/B09V3KXJPB

Effect on bounce rate

Outbound clicks are one of four factors in Clickport's multi-criteria bounce definition. A session is only marked as bounced if all four of these conditions are true:

  1. 1 or fewer pageviews
  2. No outbound link clicks
  3. Scroll depth under 25%
  4. Duration under 15 seconds

This means any session with at least one outbound click is automatically not a bounce, regardless of other factors. For affiliate sites where visitors click through to external products, this gives a much more accurate picture of engagement than a simple single-page bounce check.

Not bounced
1 pageview 1 outbound click 8% scroll 0:04 duration
Bounced
1 pageview 0 outbound clicks 8% scroll 0:04 duration
Same session behavior, but one outbound click makes the difference.

Using outbound clicks as goals

You can create goals that trigger on outbound link clicks. In the goals configuration, select Click as the goal type and add conditions to match specific clicks.

Available condition fields for click goals:

Each condition supports these operators: equals, contains, starts with, ends with, not contains, not equals, is empty, and is not empty.

Goal configuration: Amazon product click
Track clicks to a specific Amazon product
Type Click
Name Amazon product click

Field Domain contains amazon
Field ASIN is not empty n/a
Condition logic: AND (all conditions must match)

When multiple conditions are defined, they use AND logic by default (all conditions must match) or OR logic (any condition can match), depending on your configuration.

Sessions that match a click goal have their has_converted flag set, which feeds into the Conversions and Conv. Rate KPIs. See the Goals docs for full setup instructions.

Technical details

The outbound click tracker uses document.addEventListener('click', handler, true) with capture mode. This means it intercepts clicks before they propagate, ensuring the event is recorded even if the page navigates away immediately.

The click data is sent using window.clickport.beacon('c', payload), which uses fetch with keepalive: true to ensure delivery even during page unload. The event type 'c' is stored as name = 'click' in the events table.

On the server side, the session manager updates the session's has_clicked flag to 1 on the first click event, then recalculates the bounce status for the session.