Branded link shortener
A branded link shortener built for links that get printed, read aloud and typed back in, with domain verification that keeps checking after day one.
The problem
Businesses put links on posters, SMS campaigns and packaging, then have no idea which one worked, and a random short code is hard to type from a printed flyer. It serves short links from the customer’s own domain, generates a QR code for each, and counts clicks per link so every channel can be measured.
Challenges
Proving a domain is really yours
Serving links from a customer’s domain means verifying ownership and that the domain actually points at the service. Verification uses a DNS TXT record plus a resolution check, and a nightly sweep re-checks every domain, pausing (not deleting) any that stop resolving, and notifying the owner.
Slugs people can read aloud
A short code copied from paper fails if it contains characters that look alike. Generated slugs use an alphabet with the ambiguous characters removed and retry on collision, and a reserved-word list stops a custom slug from shadowing a real route.
Links that can change after printing
Once a poster is printed its link cannot change, but its destination might need to. Redirects are temporary rather than permanent, so browsers never cache the old destination and a link can be repointed at any time.
Implementation
Honest click counts
Bots are flagged at the moment a click is recorded, so reporting is a simple filter rather than a heuristic applied at query time, and older rows were backfilled with the same rule.
Expiry in local time
Links can expire, and expiry is set in the organisation’s own time zone, so "ends Friday night" means Friday night for the business.
Why this stack
- Go
- Redirects are latency-sensitive; a compiled service answers them in microseconds.
- PostgreSQL
- Links, domains and clicks with row-level tenant isolation, unique constraints for slugs, and the verification sweep’s state.
What it does
- Custom domains with ongoing DNS verification
- Readable generated slugs or custom ones
- A QR code for every link
- UTM parameters, tags and time-zone-aware expiry
- Per-link click analytics with bot filtering