Link Tracking

    How to integrate a branded link shortener with Slack

    Set up a branded domain, install a Slack app that shortens links and turns pasted passwords into one-time links, fix previews and read the clicks.

    LinkPilot Team · The people who build and run LinkPilot at TetraCore, LLC · About LinkPilot

    Most links a team shares are shared in Slack. If the shortener lives in a separate tab, people skip it, paste the long URL, and the click data never exists. Integrating a branded link shortener with Slack fixes that by putting link creation where the sharing already happens.

    This guide uses LinkPilot for Slack as the worked example, because that is the one we can describe exactly. The steps are: set up the branded domain, install the app, learn the three commands, sort out previews, and read the clicks. Alternatives for teams that would rather script it are at the end.

    What the integration should give you

    A useful Slack integration does four things. Judge any shortener's app against them.

    • Shorten in place. Turn a long URL into a short, tracked link from the message box, without opening another tool.
    • Keep secrets out of channels. Passwords get pasted into Slack constantly. A good integration replaces them with one-time links so the text never sits in history.
    • Behave with previews. Slack unfurls links. The short link should either show a correct preview of the destination or be easy to post without one.
    • Count every click in the same analytics as links made elsewhere, with source, device and country, so Slack-shared links are not a blind spot.

    Step 1: set up your branded domain

    A branded domain such as go.yourbrand.com is optional for shortening but it is the point of a branded shortener, and it is easiest to do before people start creating links.

    1. In LinkPilot, open Domains and add the subdomain you want to use.
    2. Add the CNAME record it gives you at your DNS provider.
    3. Wait for verification. LinkPilot provisions the TLS certificate through Cloudflare, so there is nothing to upload.
    4. Set the domain's defaults, such as the fallback destination for the bare domain and any branding on interstitial pages.

    Custom domains are a Pro feature, with five domains included at $29 per month. Agency plans add per-client workspaces with a domain each. The how to shorten a URL guide has more on choosing a domain and slug conventions.

    Step 2: install LinkPilot for Slack

    The install takes a couple of minutes and is per workspace, with each person connecting their own account afterwards.

    1. Go to LinkPilot for Slack and press Add to Slack.
    2. Approve the app. It asks for one permission, the commands scope, which registers two slash commands and one message shortcut. It cannot read your channels or messages.
    3. Run /shorten or /secret once. You get a private Connect LinkPilot prompt where you paste your own LinkPilot API key. API keys are on every plan, including Free.
    4. Run the command again. Setup is done, once per person.

    Because each person connects their own key, links created from Slack land in that person's LinkPilot account with its plan limits and history. Uninstalling the app removes every stored connection for the workspace.

    Step 3: shorten and share from Slack

    There are three ways to use the app once it is connected.

    /shorten a URL. Type

    /shorten https://example.com/a/very/long/page?utm_source=slack
    

    and the app replies with a short, tracked link. Paste it into the channel or thread. Clicks are recorded against the link like any other in your account.

    /secret a password. Type

    /secret hunter2 --ttl 1h
    

    and the app replies only to you with a one-time link. The channel sees the link if you choose to post it, never the text. The default lifetime is 24 hours; --ttl accepts 1h, 6h, 24h or 7d. The link is destroyed the first time it is opened.

    Send as secret link. Someone has already pasted a database password into a channel. Open the message's menu, choose Send as secret link, and the password is replaced with a one-time link. The channel keeps the link only.

    One honesty note on /secret: the text passes through Slack and through LinkPilot's Slack service, which encrypts it in memory before storage. For a secret that must never leave your own device, create the link in the LinkPilot web app, where encryption happens in your browser, and paste the link into Slack.

    Step 4: fix the previews

    Slack unfurls a link by fetching the page it points to and reading its Open Graph tags. A short link redirects to the destination, so the preview shows the destination's title, description and image. Three things go wrong:

    • No preview. The destination has no og:title or og:image, or blocks Slack's fetcher. Fix the tags on the destination page and check them with the Open Graph preview tool.
    • A stale preview. Slack caches unfurls. Changing the tags does not refresh an unfurl already shown; a new link to the same page will.
    • Too much preview. For internal links where the card is noise, wrap the URL in angle brackets or ask people to remove the unfurl. How to turn off link previews covers the per-workspace settings.

    A secret link does not unfurl into its contents. The page Slack fetches is the reveal page, and the decryption key sits in the URL fragment that is never sent to servers, so the preview shows nothing sensitive and does not consume the secret.

    Step 5: read the clicks

    Every link created through Slack shows up in the same Links list and analytics as the rest of your account. For each click LinkPilot records the referrer, the device type and the country, and filters out known bots, so a link shared in a channel gives you a real count of people rather than Slack's own preview fetches.

    A few habits make the data useful:

    • Agree a slug convention. go.brand.com/oct-launch is readable in a channel and in a report. Random slugs are neither.
    • Add UTM parameters to the destination before shortening when the click should show up in your web analytics as well. The UTM builder does this without typos.
    • Compare like with like. A link posted in a 200-person channel and one posted in a DM are not comparable on clicks alone.

    The modern guide to link tracking covers what is recorded on each click and what is not.

    Other ways to connect

    Teams that want Slack to create links automatically, for example from a form submission or a new entry in a CMS, can use the LinkPilot API and webhooks rather than the slash commands. The developers page documents the endpoints for creating links and the signed webhooks that fire on events, so a workflow tool or a small script can create the link and post it to a channel. The API is on every plan.

    Whichever route you take, the test is the same: create a link from inside Slack, click it from a phone, and confirm the click appears in analytics under the right link. If those three steps work, the integration works.

    Tools for this article

    Frequently asked questions

    Run smarter links with LinkPilot

    Tracking, UTMs, QR codes, AI insights, and white-label reporting — in one workspace. Free to start.

    Create your free account

    Read next