How to track link clicks: 4 methods, their limits, and matching clicks to sales
4 ways to track link clicks in 7 steps: shorteners, UTM tags, redirects and your own server, plus where bots and Safari skew counts and how to match sales.
Muzahid Maruf, FounderUpdated
On this page
Explore with AI
Opens this article inside the chosen assistant with a ready-made prompt.
To track link clicks, send each click through something that can count the request.
A link click tracker is a short link or redirect on a domain you control, which logs the request on the server and forwards the visitor to the destination.
A UTM-tagged URL lets Google Analytics 4 record where a visit came from. The two combine well: the redirect counts per link, and the tags name the campaign.
Bots, email scanners and Safari distort a raw count, and the count says nothing about sales until a click is matched to a payment.
We built TrackRev to do that matching: SaaS affiliate software with link tracking and revenue attribution built in. According to Google's URL builder page, 9 UTM parameters exist and 3 are required each time.
The 7 steps below take one link from tagging to a per-link revenue report.
Key takeaways
- Clicks get counted in 4 places: a shortener's server, a UTM-reading analytics script, a redirect tracker, or your own server.
- Answer tracking redirects with a 302 or 307, because a browser may reuse a cached 301 or 308 without contacting your server.
- Slack previews, Microsoft Safe Links and crawlers add requests that no person made, so filter before comparing tools.
- A visitor ID passed through checkout, such as Stripe's 200-character client_reference_id, ties a payment back to its click. I wait for a few hundred clicks per link before comparing rates.
What is a tracking link?
A tracking link, also called a tracking URL, is a link carrying enough information for a system to record its use. A tagged URL appends query-string parameters such as ?utm_source=weekly-digest.
A redirect URL points at a tracking domain, which logs the request and answers with an HTTP 302, so the method works even when the destination, such as an App Store or Google Play listing, runs none of your scripts.
For example, a newsletter footer can use go.example.com/news-footer, which logs the click and forwards the visitor to a tagged pricing page.
Google Analytics 4 reads the first form after the page loads, and a tracking server reads the second form before the page loads.
# Tagged URL: the destination carries the labels
https://example.com/pricing?utm_source=weekly-digest&utm_medium=email&utm_campaign=pricing-update-2026-10&utm_content=footer-link
# Redirect URL: the tracking domain logs the click, then forwards
https://go.example.com/news-footer -> 302 -> the tagged URL aboveWhat are the 4 ways to track link clicks?
The 4 methods for counting a link click, from a hosted Bitly link to a custom Express route, are a shortener with stats, UTM tags in Google Analytics 4, a redirect tracker on your domain and a handler you build.
First, a shortener counts requests to a short URL on the shortener's server. Second, UTM tags label a visit, and a browser script sends the count to Google.
Third, a redirect tracker logs each request on the tracker's server before forwarding the visitor. Fourth, a handler on your own server writes rows to your own database.
| Method | Where the count happens | Weakest point |
|---|---|---|
| Shortener with stats | The shortener's server | Bot rules differ by vendor |
| UTM tags in Google Analytics 4 | A browser script, then Google | Script blockers and stripped tags |
| Redirect tracker on your domain | The tracker's server | Counts requests, so bots need filtering |
| A handler you build | Your own server | You build the filtering and the reports |
How do link shorteners with built-in stats count clicks?
A link shortener is a service giving each destination a short URL and counting requests to the URL. Bitly is the best-known example, and YOURLS is the free, self-hosted version with click reports, referrer tracking and visitor geolocation.
Counting rules differ by vendor.
Bitly's help article, updated May 21, 2024, says Bitly filters known bots and large-scale abuse, flags IP addresses with an excessive click rate for a while, does not revise past metrics when a new bot is discovered, and is not built to catch click fraud.
Dub counts only the first click from each IP address and user agent pair per 1-hour period, so one campaign can total differently in the two tools.
Under a 1-hour window, 3 taps on a link at 9:00, 9:10 and 9:40 from one phone count as 1 click. Under a rawer rule, the same 3 taps count as 3.
Sources: support.bitly.com/hc · dub.co/changelog
What do UTM tags do in Google Analytics 4?
UTM tags are query-string labels that let Google Analytics 4 file a visit, and the Google Analytics 4 script does the counting.
Google's URL builder page lists 9 parameters, says to always include utm_source, utm_medium and utm_campaign, and warns that values are case sensitive, so Google and google become 2 rows.
A visitor who leaves before the tag fires, or who runs a blocker, never appears.
With outbound click measurement on, Google Analytics 4 also logs a click event, with 5 parameters including link_url and outbound, each time someone clicks a link leading away from the current domain (Google's measurement documentation).
The event covers links on your own pages and cannot see a link placed in an email or a bio.
A campaign with 3 sources and 4 content values produces 12 report rows, so a naming scheme keeps the report readable. The UTM parameters guide covers naming rules.
Why use a redirect tracker on your own domain?
A redirect tracker is a server moving the counting out of the browser. The visitor requests go.example.com/news-footer, the server records the request and replies with a 302 pointing at the tagged destination.
No script runs in the browser, so extensions blocking analytics scripts have none to stop, and a branded domain usually needs a CNAME record at your DNS provider.
RFC 9110 lists 12 heuristically cacheable codes, including 301 and 308 but not 302 or 307, so a browser or proxy can answer a repeat visit to a 301 without contacting your server, and the click is never logged.
A 302 or 307 is reused only when the response carries explicit freshness headers such as Cache-Control: max-age. Section 15.4.3 of RFC 9110 defines 302, and section 15.4.8 defines 307.
| Code | Meaning | RFC 9110 section | Heuristically cacheable | For tracking |
|---|---|---|---|---|
| 301 | Moved permanently | 15.4.2 | Yes | Avoid |
| 302 | Found, temporary | 15.4.3 | No | Standard choice |
| 303 | See other | 15.4.4 | No | Works, rarely needed |
| 307 | Temporary redirect | 15.4.8 | No | Works, keeps the method |
| 308 | Permanent redirect | 15.4.9 | Yes | Avoid |
What does a click handler on your own server look like?
A click handler is a route on your own site that looks up the slug, writes a row and sends a 302. This Express-style sketch is pseudocode, so adapt the database calls before running the code.
The handler looks up 1 slug, writes 1 row with 4 fields and answers with 1 redirect.
app.get("/go/:slug", async (req, res) => { const target = await db.links.findTarget(req.params.slug); if (!target) return res.redirect(302, "/"); await db.clicks.insert({ slug: req.params.slug, ts: new Date(), userAgent: req.get("user-agent"), referer: req.get("referer"), }); res.redirect(302, target);});Your database holds the data and no vendor limit applies, and you write the bot filtering, deduplication, geolocation and dashboards yourself.
In the browser, navigator.sendBeacon() posts up to 64 KiB without delaying navigation, and the ping attribute posts to a URL when a link is followed.
Caniuse shows ping in Chrome 15, Edge 17 and Safari 6, with Firefox shipping the attribute disabled. The server-side versus client-side comparison goes deeper.
Step 1: Why does each placement need its own link?
A placement is one slot where a link appears, such as a newsletter header, a newsletter footer or a podcast description.
One pricing page linked from those 3 slots needs 3 links, because the header reaches nearly every reader and the footer reaches only the readers who get to the end.
A single shared URL merges the data at creation, and no later report can split the data apart. Stripe gives the same advice in its docs for Payment Links: utm_content separates links pointing to one payment page.
For example, a newsletter edition with a header banner, an inline link and a footer link produces 3 rows of clicks in Step 7, and each row can earn a different revenue per click.
Step 2: What goes in the UTM tags?
Tagging the destination means adding all 4 core UTM tags to the URL for each slot, in lowercase, with the year and month in the campaign name.
One stray capital letter splits a source into 2 report rows, and the 22-character campaign name pricing-update-2026-10 sits well under the 150-character limit Stripe sets on UTM codes. The free UTM builder assembles the URL and keeps the naming consistent.
The table shows 3 tagged links for one pricing page, one per slot. A name such as pricing-update-2026-10 has 3 parts: a topic, a year and a month.
Keep a spreadsheet of campaign names, because a campaign called pricing-update-2026-10 is easy to find in October 2026 and impossible to guess in March 2027.
| Slot | utm_source | utm_medium | utm_campaign | utm_content |
|---|---|---|---|---|
| Newsletter header | weekly-digest | pricing-update-2026-10 | header-banner | |
| Newsletter footer | weekly-digest | pricing-update-2026-10 | footer-link | |
| Podcast notes | devtools-weekly | audio | sponsor-2026-11 | show-notes |
One pricing page, 3 tagged links.
Step 3: Why put a redirect in front of the tagged URL?
A redirect in front of the tagged URL is the layer counting the request on a server you control.
Create the short link on a domain you control, point the link at the tagged URL, use a 302 and confirm the query string survives. Choose a 302 or 307 so every repeat visit reaches your server.
For example, the Bitly help article dated May 21, 2024 and the Dub changelog describe different bot and deduplication rules. Let one tool own the count, because 2 tools counting the same link will disagree.
For example, Bitly and Dub apply different bot and deduplication rules, so the same campaign can total differently in the two dashboards.
Step 4: What should a test click show?
A test click is a visit you make yourself to confirm the whole chain works before the link goes out. Open the link in a private window and again on a phone over mobile data.
Check 3 things: the destination loads, the UTM tags arrive intact in the address bar, and the tracker logs one click row with the right device.
The row should resemble the sample below, with a time, a slug, an IP address, a location, a device, a referrer and a bot flag. A missing referrer is normal for apps that do not send the Referer header.
The sample row has 7 fields, and each field answers one question about the visit. A bot flag of true on your own phone points to a filtering rule that is too aggressive.
| Field | Example value | Where it comes from |
|---|---|---|
| Time | 2026-10-04 09:14:07 UTC | The tracker's server clock |
| Link | news-2026-10-header | The slug in the short URL |
| IP address | 203.0.113.7 | The connection, used for country and city |
| Location | US, Austin | A geolocation lookup on the IP address |
| Device, OS, browser | iPhone, iOS 17, Safari 17 | The user agent string |
| Referrer | linkedin.com | The Referer header, when the sending app provides one |
| Bot flag | false | A user agent and prefetch check |
Made-up values for one click.
Step 5: Which requests come from machines?
Machine requests are requests from software fetching links before a person does, and a redirect log counts every one.
The table lists 6 sources of distortion, and 3 of the 6 add requests no person made, while 2 shorten or strip the identifiers a visitor carries.
The sixth source, script blockers, hides visits from Google Analytics 4 but leaves a server-side redirect log untouched.
For example, a newsletter sent into Microsoft Defender protected inboxes can log scanner requests before any recipient reads the message, which is why the cleanup below subtracts machine traffic before computing a rate. Filter first, then compare tools.
| Source | What it does | Effect on the count |
|---|---|---|
| Slack link expanding | Slackbot-LinkExpanding 1.0 fetches a URL when someone posts it, reads its Open Graph and Twitter Card tags, and caches the response for about 30 minutes | One extra request per URL, repeated at most every 30 minutes |
| Microsoft Defender for Office 365 Safe Links | Scans URLs before delivery and detonates links without a valid reputation in the background | Requests from a scanner before the recipient reads the email |
| Apple Mail Privacy Protection | Downloads remote content in the background through 2 relays, whether or not the recipient engages | Open counts become unreliable, so clicks are the safer email metric |
| Script blockers | Stop the analytics tag from loading | Google Analytics 4 undercounts; a server-side redirect log is unaffected |
| Safari Intelligent Tracking Prevention | Deletes script-created cookies after 7 days without a visit and caps them at 24 hours after tracker-style link decoration | A visitor ID written by JavaScript expires early |
| Safari 17 Private Browsing | Blocks known tracking query parameters in links | Some tracking parameters are stripped before the page loads |
How much does bot filtering change a click count?
Bot filtering is the step turning a raw request log into a count of people, and the step can change a click rate by several points.
In the example, 310 of 1,150 logged requests, or 27%, came from machines, and 40 more were repeats.
The table walks through a send to 8,000 recipients, with invented numbers: the unfiltered log reports 14.4% where the filtered log reports 10%.
In our redirect, known crawler user agents, empty user agents and prefetch requests are flagged as bots, still redirected, and left out of analytics and attribution.
The bot filtering guide covers the signals, and the Safari ITP post covers the cookie caps.
| Stage | Requests | Basis |
|---|---|---|
| Logged by the redirect | 1,150 | Everything the server saw |
| Flagged as bots or prefetch | 310 | Scanner and crawler user agents |
| Repeats within 1 hour | 40 | Same IP address and user agent |
| Counted clicks | 800 | 1,150 minus 310 minus 40 |
| Click rate | 10% | 800 divided by 8,000 recipients |
The unfiltered log would report 1,150 divided by 8,000, or 14.4%.
Step 6: What carries a click through to the payment?
A click becomes conversion data when something joins the click record to the payment record.
The usual key is a visitor ID: the redirect sets a first-party cookie, the signup or checkout step passes the ID along, and the payment event returns with the ID attached.
Stripe Payment Links give you 2 places to carry data, described on Stripe's URL parameters page: client_reference_id with a 200-character limit, and the UTM codes with a 150-character limit. The Stripe Payment Links walkthrough shows the setup.
Stripe also notes that bank debits and vouchers can take 2 to 14 days to confirm, which adds to the gap between click and payment.
A 36-character visitor ID, such as a UUID, fits inside the 200-character limit 5 times over.
| Parameter | Limit | Where it comes back |
|---|---|---|
client_reference_id | 200 characters | The checkout.session.completed event |
utm_source and the other UTM codes | 150 characters | The confirmation redirect URL, when that behavior is set to redirect |
How long can a sale still be credited to a click?
The attribution window is the number of days after a click in which a payment still earns credit.
Say a visitor clicks a tracked link on October 1 and pays on October 19, so 18 days pass between click and payment.
The 7-day window misses the payment by 11 days and the 14-day window by 4, while the 30-day window leaves 12 days to spare and the 90-day window leaves 72.
If the visitor ID sat in a cookie written by JavaScript and the person stayed away for 7 days, Safari deleted the cookie, so a payment on day 18 has nothing to match.
WebKit's 7-day rule covers cookies created in JavaScript, so an ID set in the redirect's response header falls outside the rule.
WebKit also classifies domains that do enough top-frame redirects as cross-site trackers, and deletes a classified domain's data after 30 days of browser use without a first-party visit.
| Window in days | Days to spare | Credited |
|---|---|---|
| 7 | -11 | No |
| 14 | -4 | No |
| 30 | 12 | Yes |
| 90 | 72 | Yes |
18 days pass between click and payment.
Step 7: What do per-link results show?
Per-link results are the revenue and conversion figures for each placement, and per-link figures expose differences a channel total hides. Take one newsletter edition with 4 links to a $39 a month plan, with invented numbers.
The footer earns $0.43 a click against $1.95 for the header, a gap the $1.49 channel average hides.
Volume limits how far to trust a row: the PS line reads 4.4% on 90 clicks, and one fewer sale would read 3.3%, so a single payment moves the rate by 1.1 points.
Until each link has a few hundred clicks, I read the channel total and keep collecting per link, since link rows sum into channel totals.
| Link | Clicks | Signups | Conversion | First-month revenue | Revenue per click |
|---|---|---|---|---|---|
| Header banner | 620 | 31 | 5.0% | $1,209 | $1.95 |
| Inline link | 340 | 10 | 2.9% | $390 | $1.15 |
| Footer link | 180 | 2 | 1.1% | $78 | $0.43 |
| PS line | 90 | 4 | 4.4% | $156 | $1.73 |
| Channel total | 1,230 | 47 | 3.8% | $1,833 | $1.49 |
Hypothetical figures.
How does TrackRev track link clicks and the revenue behind them?
TrackRev is SaaS affiliate software for indie hackers and small SaaS teams, and its link click tracking runs the redirect method with the revenue join built in.
Every tracked link resolves through a /r/slug redirect on a trackrev.io short domain or on your own domain.
In our redirect, the server logs timestamp, referrer, device, browser, OS and city-level location before the 302, and sets a first-party visitor cookie lasting 365 days. Click capture needs no script on your site.
Revenue attribution adds one first-party pixel, and on a paid plan the pixel matches each charge from 1 of 6 processors (Stripe, Paddle Billing, Polar, Lemon Squeezy, Creem or Dodo Payments) to the clicks before it, using last-touch, first-touch or linear credit.
Paid plans cost $29 a month for Indie and $299 a year for Growth. The free plan allows 50 links and 1,000 tracked events a month, and both paid plans allow unlimited links and events.
The Links and Analytics page has the details.
| Plan | Price | Links | Tracked events a month | Revenue figures |
|---|---|---|---|---|
| Free | $0 | 50 | 1,000 | Hidden |
| Indie | $29 a month | Unlimited | Unlimited | Shown |
| Growth | $299 a year | Unlimited | Unlimited | Shown |
From the pricing page. The 2 paid plans differ on workspaces (1 or up to 10), tracked domains (1 or up to 10) and team members (owner only or unlimited).
When does a plain shortener or your own handler fit better?
A plain shortener such as Bitly fits when you need counts on a few links and sell nothing online.
YOURLS or the handler above fits when you want everything on your own hardware, with no vendor limit and no third party holding the click rows.
TrackRev fits when the question is revenue: which link, partner or channel produced the charge. In our Links and Analytics product, the free plan hides revenue figures, so the free tier suits click counts only.
Otherwise start on the free plan with 50 links and 1,000 tracked events a month. Paid plans start at $29 a month for Indie, and Growth at $299 a year adds up to 10 workspaces and 10 tracked domains.
Found this useful? Share it.
Frequently asked questions
- Any URL built so a system can record its use. One form carries UTM labels in its query string, and the other points at a domain that logs each request before redirecting. Google lists 9 UTM parameters and asks for 3 every time.
- Yes. A standard Google Analytics 4 property reads UTM-tagged links at no cost, YOURLS is free open-source software you host yourself, and TrackRev's Free plan covers 50 links and 1,000 events monthly. Free setups usually give counts without revenue.
- Each tool deduplicates differently. With a 1-hour window, 5 refreshes in 10 minutes count as 1 click in one tool and 5 in a raw log. Google Analytics 4 records 0 for any visit where its script was blocked, and a shortener also logs scanner and bot requests that never run a script.
- MDN's status code pages say search engines pass SEO ranking to the new URL after a 301 and transfer none after a 302. For a guest post or partner page where ranking value matters, ask for a direct link instead. Redirect links suit email, social posts, ads and print.
- As long as the attribution window you set, whatever the cookie lifetime. A visitor cookie can last 365 days while a 30-day window credits only payments inside 30 days of the click, so day 45 goes uncredited.
- No fixed threshold exists, but the arithmetic shows the problem. At 180 clicks one sale shifts conversion by 0.56 points, and at 1,000 clicks by 0.1 points. Hundreds of clicks per link make a fair floor for ranking.

Written by
Founder, TrackRev.io & Contant.io
Muzahid Maruf founded TrackRev.io, SaaS affiliate software with no limit on tracked revenue, and Contant.io. He writes about affiliate programs.
Writes about Marketing attribution · Link tracking · Revenue analytics · SaaS growth
Run your affiliate program without a revenue cap.
Affiliate software for indie hackers and small SaaS teams: $29 a month flat, 0% fees, link tracking and revenue attribution built in. Free to start, no card.