Tracking links shared in Slack and Discord: a six-step setup that ignores preview bots

Slack and Discord clicks often carry no source, and preview bots hit your link first. Give each place its own short link and count clicks on your own server.

Muzahid Maruf — Founder of TrackRev.io

Muzahid MarufUpdated

Link tracking · 10 min read
On this page
  1. 01Why Slack and Discord clicks arrive without a source
  2. 02What the preview crawlers do to your click count
  3. 03How to track links shared in Slack and Discord
  4. 04What these links can't tell you
  5. 05What TrackRev does here, and when you don't need it

Explore with AI

Opens this article inside the chosen assistant with a ready-made prompt.

To track links shared in Slack and Discord, give each channel or server its own short link on a domain you control and count clicks at that redirect.

A click from a chat app often reaches your site with no referring page, which Google Analytics 4 reports as Direct, and both apps fetch the URL themselves within moments of the post, so your log shows a bot request before the first person clicks.

This works for links you control: ones you post, or hand to a customer or community manager to post.

Key takeaways

  • Google Analytics 4 files a session as Direct when its source is exactly (direct) and its medium is (none) or (not set), which is how an untagged click from a chat app can land.
  • Slackbot-LinkExpanding 1.0 and Discordbot/2.0 fetch a link the moment it is posted, and Slack ignores robots.txt and caches for about 30 minutes, so the filter has to live in your own click log.
  • One short link per channel, server or workspace carries the source even when the app sends no referrer.
  • Flag crawler requests and still redirect them. Then rank links by revenue per 100 clicks once the trial and confirmation time have passed: in the invented example, 86 clicks earn $181.40 per 100 and 1,190 clicks earn $9.83.
  • TrackRev is affiliate software with link tracking built in: its Free plan covers 50 links and 1,000 tracked events a month, and revenue per link starts on Indie at $29 a month.

Why Slack and Discord clicks arrive without a source

Alexis Madrigal named the problem in The Atlantic on October 12, 2012. He called it dark social: visits with no referrer data, which he traced to email programs, instant messages, some mobile apps and secure-to-non-secure links.

Analytics tools file them as direct. Google Analytics 4 does so by rule.

Its default channel group defines Direct as a source of exactly (direct) with a medium of (none) or (not set), and Google's direct traffic help adds that redirects and URL shorteners can strip the details that identify a source.

Web clients can drop the referrer too: rel="noreferrer" makes the browser omit the Referer header, MDN says. Whether each Slack and Discord client sends one today is worth measuring in step 2, and an app update can change the answer.

What the preview crawlers do to your click count

Both apps request a link when someone posts it, to draw a preview card, and those requests reach your server before any reader does.

CrawlerUser agentWhat it doesSource
Slackbot-LinkExpandingSlackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)Reads oEmbed, Twitter Card and Open Graph tags with HTTP Range headers, then fetches any image, video or audio file those tags nameSlack Robots page
Slack-ImgProxySlack-ImgProxy 0.19 (+https://api.slack.com/robots)Fetches and caches images posted to channelsSlack Robots page
SlackbotSlackbot 1.0 (+https://api.slack.com/robots)Makes every other HTTP request Slack needs, such as API calls and outgoing webhooksSlack Robots page
DiscordbotMozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)Visits a link when it is shared in a message to build the preview card, and does no continuous crawlingDiscord Support
RuleThresholdSource
Slackbot-LinkExpanding responses are cached across the serviceAround 30 minutes, at most 1 request per URLSlack Robots page
No preview expands for a link already shared in the same conversationWithin 1 hourSlack Help Center
No preview expands in a message withMore than 5 linksSlack Help Center

Slack preview rules that shape what reaches your log.

Slack ignores robots.txt, saying it acts for a human and does not follow links like a crawler.

Because the cache is service-wide, one link posted in 3 workspaces within half an hour can produce a single Slackbot request that no log can assign to a workspace.

Version numbers drift: Slack's page shows Slack-ImgProxy 0.19, while the crawler-user-agents list on GitHub records 0.59, 0.66, 1.106, 1.138 and 149. Discord's help article, updated October 3, 2026, says to match the word Discordbot anywhere in the string.

Time (UTC)LinkUser agentCounted
14:02:09sl-toolsSlackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)No
14:02:11dc-launchesMozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)No
14:03:40dc-launchesiPhone 15, Safari 17.5Yes
14:05:27sl-toolsWindows 11, Chrome 130Yes
14:09:12dc-launchesWindows 10, Firefox 131Yes
14:21:58sl-toolsMacBook Air, Safari 17.4Yes
14:31:15dc-launchesUbuntu 24.04, Chromium 130Yes
14:48:30dc-launchesPixel 8, Chrome 130Yes
15:02:44sl-toolsiPad Air, Safari 17.5Yes
15:20:03sl-toolsGalaxy S23, Chrome 129Yes

Invented log for 2 links over about an hour. Counting every row reports 10 clicks for 8 visits, 25% too many.

The examples below follow one page, example.com/pricing, posted in 1 Discord server, 2 Slack workspaces and a set of founder DMs, with a $39 monthly plan.

Create one link per place, each pointing at the same destination, and name it after the place: Discord #launches, Community Slack #tools, Acme customer Slack. Every click then belongs to that place whether or not the app sends a referrer.

In TrackRev's New campaign form, pick "A link per channel" and add a custom short link.

The channel picker offers 9 channels and neither Slack nor Discord is one, but bulk CSV import (up to 500 rows) and the REST API accept both.

A slack or discord row stamps utm_source and utm_medium=social on the destination, unless the destination already has its own tags.

bulk-import.csv: one row per place, all pointing at the same page
url,name,channel,utm_campaign,utm_term,utm_content,tags
https://example.com/pricing,Discord #launches,discord,oct-launch,,launches,community
https://example.com/pricing,Community Slack #tools,slack,oct-launch,,tools,community
https://example.com/pricing,Acme customer Slack,slack,oct-launch,,acme,customer

Skip Smart Links for these two apps. A Smart Link guesses the channel from the referrer. Slack proxies or strips the referrer, so TrackRev has no Slack mapping and those clicks land in Other or Direct.

Discord is on the recognized list, but only a click carrying a discord.com referrer gets the label.

Put the links on your own domain with one CNAME record (custom tracking domains). If you tag destination URLs by hand, the free UTM builder writes the tags, and medium social lands in Organic Social under Google's channel rules.

A redirect that forgets to forward the query string drops them, and the 5-step stripped-UTM test finds the hop that does it.

Step 2: Post a test link in each app

Post a fresh link in a private channel or test server on each client: desktop, web and phone. That is 6 test posts across the 2 apps.

Use a new link per test because of the 1-hour rule above, and one link per message because Slack expands none in a message with more than 5, then click each one from each client and read the report.

A client that sends no referrer costs you nothing, because the link's name carries the source.

What to readWhereWhat you may find
The preview fetchGET /api/v1/clicks?bots=includeA row with a Slackbot-LinkExpanding or Discordbot user agent and is_bot set to true
The referrerThe Top referrers card on the link's pageNothing, a chat domain, or the browser's own page, depending on the client
Device and browserThe breakdown cards on the same pageWhatever you clicked from, so check it against the phone or laptop in your hand

Step 3: Flag preview fetches and still redirect them

Match crawlers on a user-agent substring (Slackbot, Discordbot), flag the request as a bot, store it, and leave it out of the counts. I would not block them, because a refused fetch leaves the post bare.

Discord publishes its public IP ranges in 2 formats, JSON and TXT, for anything that needs more than a spoofable user agent. The bot filtering guide covers prefetch headers and empty user agents.

TrackRev does this at the redirect with the isbot 5 user-agent list, which matches all 4 crawlers in the first table, plus empty user agents and prefetch headers.

A flagged request is still redirected and stored with is_bot set, and the link page, attribution and partner reports leave it out.

Step 4: Carry the click to the signup and the payment

A click becomes revenue when the visitor ID reaches the payment.

TrackRev's first-party pixel reads the ID on your first pageview, an email address binds the visitor to the customer at signup or checkout, and Stripe is read with a restricted key every hour, or by webhook for updates within seconds.

Built by hand, the shape is the same:

HopFieldLimit
Redirect responsevid cookie, plus a _vid URL parameter in TrackRev1 year for the cookie
Stripe Payment Linkclient_reference_id, returned in checkout.session.completed200 characters
Stripe objects with metadataMetadata key-value pairs50 pairs, keys to 40 characters, values to 500

The Payment Links walkthrough has the setup.

Two gaps stay open: a click in the phone app followed by a laptop visit to your address arrives as Direct, and a signup email that differs from the payment email can slip past the join.

Raw clicks reward the biggest audience. Divide by counted clicks to compare places of different sizes.

LinkCounted clicksSignupsPaidSignups per 100 clicksMRRMRR per 100 clicks
Discord #launches1,1901431.18$117$9.83
Community Slack #tools640911.41$39$6.09
Acme customer Slack3021163.64$234$77.48
Founder DM shares86646.98$156$181.40

Invented numbers on a $39 monthly plan. The Discord link has the most clicks and the founder DMs have the highest revenue per 100 clicks.

Discord #launches brings 53.7% of the 2,218 clicks and 21.4% of the $546 MRR. The founder DMs bring 3.9% of the clicks and 28.6% of the MRR.

Acme converts 6 of 11 signups to paid (54.5%) against 3 of 14 for Discord (21.4%).

Four paying customers from 86 clicks is too small a sample to repeat on purpose, so test the lead with a second batch of DMs.

A link's revenue arrives after the click by the length of your trial plus the payment's confirmation time, and some payment methods, such as SEPA Direct Debit, confirm later.

For a 14-day trial and a click on October 1 (a 30-day trial moves the charge to October 31):

EventDateDays after click
ClickOctober 10
Trial ends, first card charge in StripeOctober 1514
Alternative: a 30-day trial ends, first card chargeOctober 3130
Earliest fair comparisonSome days after October 15, once Stripe reports the debit as paid15 or more

A redirect logs a device, a place and a time, and a name appears only when the visitor later signs up.

A Slack link copied into a DM keeps crediting its original place, and a teammate who types your domain without the link sends Direct traffic.

A signup field asking how people heard about you catches those, and the post on self-reported versus tracked attribution covers weighing the two.

What TrackRev does here, and when you don't need it

TrackRev is SaaS affiliate software with link tracking built in.

It logs each click on the server with time, country, city, device, browser, operating system and referrer, adds the link's saved UTM tags to the destination, and joins clicks to payments from Stripe, Paddle Billing, Polar, Lemon Squeezy, Creem and Dodo Payments.

Revenue per link needs a paid plan (pricing).

PlanPriceLinksTracked eventsRevenue per link
Free$0501,000 a monthHidden
Indie$29 a monthUnlimitedUnlimitedShown
Growth$299 a yearUnlimitedUnlimitedShown

TrackRev plans for link tracking, October 2026.

If you only need to know whether Slack sends sessions, a UTM link and Google Analytics 4 are free and enough, and any shortener with bot filtering covers plain click counts.

The Links and Analytics page lists what a link records.

Found this useful? Share it.

PostLinkedIn

Frequently asked questions

Muzahid Maruf — Founder of TrackRev.io

Written by

Muzahid Maruf

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

Stop guessing where your revenue comes from.

Set up TrackRev in about five minutes. The free plan covers 1,000 events a month, no card needed.

Start free