Shorthop

Cookieless link analytics

Shorthop counts clicks and unique visitors without cookies and without storing IP addresses. This page sets out what it records, how long it keeps it and how the daily hash works, so you can write your privacy notice.

Shorthop is an open-source (MIT) link shortener that runs as one Cloudflare Worker in your own account. It shows the clicks on each link and the payments they led to, and it stores no IP addresses and sets no cookies.

Product facts from the Shorthop repository, version 2.0.1. Other companies’ plans and limits checked on their own pages on .

What is recorded per click

Each request to a short domain becomes one data point in Cloudflare Analytics Engine, written after the redirect has been sent. So recording a click never slows it down.

DataWhere it comes from
Time, short domain and slug (or the missed path)The request
Click, bot or missShorthop’s own classification
Country, region, city and continentCloudflare’s IP geolocation
The city’s position, rounded to 0.1° (about 11 km), for the live mapCloudflare’s IP geolocation
Network operator and Cloudflare data centerCloudflare
Device type, operating system, browser and preferred languageThe User-Agent, client hints and Accept-Language headers
Referring website (host name only) and source tagThe Referer header and the link
Bot name, for previews and crawlersThe User-Agent
Visitor hashSee how unique visitors are counted, below

Humans, bots and misses are counted apart. Bots still get the redirect.

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.
the live map: cities rounded to about 11 km (made-up stats)

What is never stored

  • IP addresses. They are used during the request, because Cloudflare derives the location from them and the visitor hash needs them. They are never stored.
  • Cookies. Visitors get none, because a short link is a redirect. The one exception is a password-protected link: after the right password, a cookie for that link only (sh_access) remembers it for 12 hours. It holds no personal data, only a signed expiry.
  • Full referrer addresses. Only the host name of the referring site is kept.

How unique visitors are counted

A visitor hash is the first 16 hex characters of SHA-256 over the IP address, the user agent, the UTC date, a secret salt and a random salt for that day. The secret salt is VISITOR_SALT, or on an install without it, a random value generated once and kept in D1.

The daily job runs at 01:15 UTC and deletes the salt of each day that has ended. After that, nobody can work out whose visit a hash was, the owner included, even with a known IP address. The hash changes every day, so it can’t follow a visitor from one day to the next. The statistics show the sum of daily unique visitors.

Deleting the salt is the point. Once a day is over, nobody can trace that day’s hashes back to a visitor.

How long it is kept

DataKept
Each click in Analytics EngineAbout 90 days. Cloudflare deletes them; they can’t be deleted earlier.
Daily totals in D1, per link, country, device, source and moreUntil you delete the link’s domain, or the database. Counts only, no hashes.
The day’s saltUntil the daily job after that day ends.
Missed pathsAs set on the Misses page: 30 days, 2 months or 3 months.
Customers’ emails and customer IDs on paymentsAs set for the site, 1 to 7 years, or until you erase the person.

Cloudflare’s Analytics Engine limits say data written to it is stored for three months (checked ). Shorthop copies each finished day into D1, so your statistics outlive that.

On your own website

If you put Shorthop’s script on your website to see what link visitors do there, each site chooses how a visitor is told apart.

  • Cookieless (the default): the visitor ID is a hash of the IP address, the user agent and the site, with the same daily salt as short links. Nothing is stored in the browser, and the ID changes every day.
  • Recognise returning visitors: one random ID in the browser’s localStorage (sh_vid, not a cookie), first-party on your domain. In the EU this needs consent.
  • After consent: cookieless until your consent banner, or the built-in one, records consent.

With Respect Global Privacy Control on, visitors who send Global Privacy Control or Do Not Track are always counted cookieless, whatever the site’s setting. No IP address and no full referrer address is stored for website visits either.

The site’s visits also feed revenue per short link. A short link to a tracked site adds a signed sh_c parameter naming the click. The script reads it on the first page and removes it from the address bar. It holds no personal data and is valid for 7 days.

Payments and customers

With a payment provider connected, Shorthop keeps each payment’s amount and currency, its kind (charge, refund or dispute), the provider’s customer, order and subscription IDs, the customer’s email when the provider sends one, and the visit it was matched to. Only people with the See revenue permission see them.

You can find one visitor or customer by email, visitor ID or payment ID, export everything stored about them as JSON, or erase them. Erasing keeps the payment amounts, so revenue reports still add up. A site can also drop customers’ details after 1 to 7 years on its own.

Your privacy notice

Under the GDPR and similar laws, you, the operator, are responsible for telling visitors what you record. Shorthop’s privacy document has a starting text for a short-link notice and one for a tracked website, to adapt to your service and your country. It isn’t legal advice.

Read the full visitor privacy document on GitHub, or see the summary on the home page.

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.

back to the board