Shorthop

Short links on your own domain, and the customers they bring.

Put a link in a LinkedIn post or on a printed QR code, then see the clicks, the visits and the Stripe payment it led to.

One Cloudflare Worker in your own account, free for most personal use. MIT licence. Read the code on GitHub

Take one

  • go.example.com/launch, torn off. Sample data: 312 clicks, €480.
  • go.example.com/qr-menu, torn off. Sample data: 41 scans.
  • go.example.com/newsletter, torn off. Sample data: 127 clicks, €96.
  • Deploy to CloudflareAsks only for an admin password
The Shorthop analytics home: human clicks, unique visitors, revenue and bots for the last 30 days, a chart of clicks by day, and the top links with their revenue.
the admin, at /_admin (made-up stats)

torn this week:

480 clicks · €576

sample data

Why people switch to Shorthop

What users of hosted shorteners keep running into, and what Shorthop does instead.

What happens elsewhereWith Shorthop
Elsewhere: Links and QR codes stop working when a plan lapses or an account is bannedWith Shorthop: Links live in your own Cloudflare account, on your domain. No shortener’s billing sits between you and them.
Elsewhere: Free links get ads, or a page before the destinationWith Shorthop: A plain 302 to the destination, after one KV read.
Elsewhere: Click history cut to 30 days on cheaper plansWith Shorthop: Daily statistics stay in your own database until you delete them. Individual clicks are kept for 90 days.
Elsewhere: Exports locked to higher plansWith Shorthop: Links with every setting, statistics and payments as CSV or JSON, or everything as one backup, any time.
Elsewhere: A monthly cap on changing where a link goesWith Shorthop: Change any link whenever you like (Workers Free allows 1,000 saves a day). Every version is kept and can be restored.
Elsewhere: Revenue tracking only on a top plan, or under a commercial licenseWith Shorthop: Revenue from Stripe, Paddle, Lemon Squeezy, Dodo Payments, Creem, Gumroad, FastSpring and PayPal, matched to the link that brought each buyer. MIT-licensed.
Elsewhere: Priced per seatWith Shorthop: Admins, managers and users with their own permissions, at no cost. Cloudflare Access is free for up to 50 users.

Coming from Bitly, Rebrandly, Short.io or Dub? Your links come along.

How a click turns into a customer

Shorthop is an open-source link shortener that runs as one Cloudflare Worker in your own account. A short link takes someone to your site, and Shorthop follows that visit to the payment it led to. Revenue is broken down by link, channel, campaign and landing page.

  1. The QR studio for the /course link: a dark green dotted code with a logo and the caption Shipping Small: the course, and a note that it scans correctly in a test decode.
    QR studio: print it, scans count on their own

    Put the link out

    Use it in a post, a newsletter or a bio, or print it as a QR code with your colours, a logo and a caption. Scans are counted as their own source, and the destination can change any time without reprinting.

  2. Recent hits on a live map: 318 clicks from 38 countries in the last 24 hours, dots on a globe, and the top countries led by the United States.
    live map: the last 24 hours, to the nearest city

    Someone clicks

    One KV read, then a plain 302 to the destination. Analytics is written after the response, so it never slows a click down. The click shows up with its country, city, device and source.

  3. A website dashboard: the path to money from 6,857 visitors to 473 who took an action to 101 who paid, MRR, and revenue per short link such as /launch and /trial.
    path to money: came, acted, paid

    They visit your site

    One script tag of about 8 KB records visits, pages and goals. Short links to a tracked site carry a signed click token, so each visit is tied to the link that sent it.

  4. The page for one short link, /course: 623 human clicks, 531 unique visitors and $5,668 in revenue from 34 customers over 30 days.
    /course: 623 clicks, $5,668

    They pay

    Stripe, Paddle, Lemon Squeezy, Dodo Payments, Creem, Gumroad, FastSpring and PayPal send verified webhooks. Each payment is matched to the visit that led to it, with how sure the match is. A link straight to a checkout is credited too, with no website in between.

    How revenue per link works

Screenshots from local development with made-up sites, links, customers and stats.

Everything else on the board

Smart routing

Rules by device (iPhone and iPad, Android, desktop, other) and by country. First match wins. Split traffic across up to 10 weighted destinations for an A/B test, try it in the simulator, then read the results per rule and variant on the link page.

The smart routing editor with an A/B split between two destinations and a rule for one country.

Bio pages

A link can be a link-in-bio page. Its buttons are your own short links, so every tap is counted.

A public bio page on a phone: a name, a short text and a column of buttons that are short links.

Leaving another shortener

Import from Bitly, Rebrandly, Short.io or Dub by their API or their CSV export. Old click counts are kept. Links on their own domains (bit.ly, rebrand.ly, short.gy, dub.sh) move to yours with the same back-half.

Website analytics

One script tag, about 8 KB. Visits, sources, goals, funnels, scroll depth and Core Web Vitals from real visits. It works on plain HTML, Next.js, WordPress, Shopify, Webflow, Framer, Wix, Squarespace, Ghost and anything else that lets you add a tag to the page head.

Subscriptions and refunds

MRR, churn, and new against renewal revenue. Refunds and disputes follow their charge. Amounts are converted at the day’s ECB rate.

Keeping links working

  • Destination checks, with one email after 3 failures in a row
  • A report of slugs people tried that don’t exist
  • Retired links that point to a replacement, and your own 404 page
  • A warning page before destinations Cloudflare flags as malware or phishing
  • Every change saved as a version you can restore

AI assistants, API and webhooks

Claude Code, Cursor or VS Code can create links and read statistics through the MCP server at /api/mcp, with your API key and its permissions. Or install the skill:

npx skills add jntegz/shorthop

Signed webhooks, personal API keys and an iOS Shortcut too.

When people click

A weekday by hour heatmap in your own time zone, per link and for the whole account, so you know when to post.

People and roles

Add admins, managers and users with Cloudflare Access, each with their own password and the permissions you tick.

No cookies. No IP addresses.

Nothing is stored in the visitor’s browser and no IP addresses are kept. Unique visitors are counted with a daily hash of the IP address, user agent and date, mixed with a secret salt and a random salt for that day.

The daily job deletes each day’s salt once the day is over. After that nobody, the owner included, can work out whose visit a hash was, and hashes can’t be followed across days.

Website analytics are cookieless by default. A site can respect Global Privacy Control and Do Not Track.

What is recorded, and for how long

Everything stays in your account

Links live on your own short domain, and every number stays in your Cloudflare account. Daily statistics stay in your own D1 database until you delete them, and individual clicks are kept for 90 days.

Download every table as one ZIP whenever you like, or bind an R2 bucket for a copy every week. The code is MIT-licensed.

what it records, for your privacy notice

Put it up in your own account

With the Deploy button, no terminal

You need a Cloudflare account (free is fine). For your own short domain, its DNS must be on Cloudflare in the same account. A spare subdomain such as go.example.com works too.

  1. Press the button and sign in to Cloudflare.
  2. Connect GitHub or GitLab. Cloudflare copies Shorthop into a new repository on your account. It can be private.
  3. On the setup page, fill in ADMIN_PASSWORD: a long random password, at least 9 characters. Leave every other field as it is.
  4. Press deploy. Cloudflare creates the KV namespace and the D1 database. Both are free.
  5. Open /_admin/ on your workers.dev address and sign in.
  6. Add your short domain: in your copy of the repository, set SHORT_DOMAINS and the routes line in wrangler.toml, and commit.
Deploy to Cloudflare

Every step, the domain and the limits: the install guide

Or with Wrangler and the setup wizard

You need Node.js 22.12 or newer as well. The wizard asks for your domains, how to protect the admin, your password and how to send email, then deploys and checks the result.

git clone https://github.com/jntegz/shorthop.git
cd shorthop
npm ci
npx wrangler login
npm run setup

What it costs

Usually nothing.

Workers Free covers most personal use:

  • 100,000 requests a day
  • 1,000 link saves a day
  • 10 ms of CPU per request
  • 50 Cloudflare Access users

Workers Paid, $5 a month, raises the limits.

On Free, the daily requests are a hard cap for the whole account: once they are used up, every short link fails until midnight UTC. Add a rate-limiting rule, and choose Paid if your links must not go down.

Questions people pin up

Why a 302 and not a 301?

Browsers keep a 301 forever, so after the first click they would skip Shorthop. A changed target or an expired link would no longer reach those people, and their repeat clicks wouldn’t count. A 302 keeps every link editable and every click measured. Search engines still follow it.

What does it cost?

Usually nothing. A personal shortener fits inside Workers Free: 100,000 requests and 1,000 link saves a day.

What Workers Free allows

How long are stats kept?

Analytics Engine keeps raw clicks for about 90 days. A daily job copies each finished day into D1, where it stays until you delete it.

Can I show a sponsor the clicks?

Yes. Create a shared statistics page on the link’s page and send its address. They see clicks, daily visitors, countries, sources and devices, read-only, without signing in. The destination and any revenue stay private.

Will my Bitly QR codes keep working?

Codes on your own branded domain will. Import the links, point the domain to Shorthop, and the same addresses resolve. Codes that contain a bit.ly address keep pointing at Bitly.

How to move from Bitly

Can I use it without Cloudflare?

No. Shorthop is built on Workers, KV, D1 and Analytics Engine directly.

Put your own flyer up.

Your links on your domain, and every number in your own Cloudflare account. Cloudflare’s setup page asks only for an admin password.