--- title: Tracking redirects minimally date: 2026-05-07T16:28:22+08:00 categories: - coding - tools description: I use static HTML files with meta refresh tags and GoatCounter to track redirects minimally. Hosting these on CloudFlare R2 provides a fast, free alternative to shortener services like Bitly without the risk of vendor lock-in. keywords: [url shortener, goatcounter, cloudflare r2, meta refresh, static html, analytics, redirect tracking] --- Everyone needs a tracking URL shortener. - **Why tracking?** I want to know if they opened my email and clicked the link. - **Why shortener?** I want them to know what the link is about. For example, is so much more meaningful than I've used redirection services in the past - like `t.co`, `bit.ly`, `goo.gl`, `ow.ly`, and others. They tend to vanish, start charging, serve ads, etc. Here's my solution: **use static HTML for redirection**. ![](https://files.s-anand.net/images/2026-05-07-tracking-redirects-minimally.avif) For example, redirects to . Here's the code: ``` ``` The first line sets up tracking with [GoatCounter](https://www.goatcounter.com/), which is my current favorite analytics provider. It might vanish, but I can export the data if required and move to another. While it lasts, I can check how often the link was used. I can create personalized links. For example, tags `user1`. I can create unique links for each recipient. The second redirects to the target page immediately. I have deployed the files on a CloudFlare R2 bucket with a custom domain, which is practically free and fast. But I can switch at any point to any other hosting provider (e.g. GitHub Pages, etc.) by just copying the files and changing the DNS settings. **Advantages**: No hosting, no fees, no maintainance, no vendor lock-in.