I built my own QR code system on Cloudflare (and you probably should too)

Gerry White • December 1, 2026

Short version: I've built my own QR code and short link system on qr.dergal.co.uk, running on Cloudflare. It handles the redirects, counts every scan, makes the QR codes (and NFC links), and checks once a week that nothing it points at has broken. It costs nothing to run, and because it sits on my own domain, no QR company gets to decide where my printed codes end up.

I put QR codes on quite a few things: slides at conferences, business cards, event bits and pieces. Like most people, I'd been using whichever generator came up first in Google. It's fine until you stop and think about what happens to those codes in two years' time, and this week Xerox gave everyone a very good reason to think about it (more on that below).

So I built my own. This is what it does, what caught me out, and what it costs.

What I built

I wanted short links on my own domain, a QR code for each one, and some idea of whether anyone actually scans them. It took an afternoon. The setup is roughly:

  1. Someone scans a code pointing at qr.dergal.co.uk/something.
  2. A Cloudflare Worker (a small bit of code that runs on Cloudflare's network) looks "something" up in a D1 database and sends them on to wherever that link points today.
  3. On the way past it logs the scan: time, rough location, device, browser, and whether it came from a QR code, an NFC tag or a plain link. It doesn't store IP addresses, and it ignores bots.
  4. The admin sits on a separate subdomain behind Cloudflare Access, so the only way in is my login.

The dashboard, here with made-up data so I'm not sharing my own numbers.

From the admin I can create a link and download its QR code as an SVG for print or a PNG for screens, with my logo in the middle if I want it. I can change where a link goes whenever I like, pause it, or download a zip of every code with a given tag for the printer. Each link also has an NFC version, because I fancy putting a few tags on things, and taps get counted separately from scans.

Every link gets a QR code, with or without a logo.

The feature I'm happiest with is the dullest one. Once a week it checks every destination, and anything returning a 404 or a server error shows up in red. Printed codes tend to outlive the pages they point at, usually because someone rebuilt the website, and I'd rather find that out before a customer does.

An old workshop flyer pointing at a page that no longer exists.

Why not just use a QR code generator?

Most "dynamic" QR codes, the ones you can edit after printing, don't point at your website at all. They point at the generator's own short link, which then forwards to you. That's how you get to change the destination later, and it's also how they hold you to the subscription. Uniqode's own guide is pretty upfront that one missed renewal can switch off every dynamic code on an account at once, that free plans can cap you at 50 or 100 scans a month, and that if the provider shuts down or gets bought, the codes go with it.

Think about where QR codes end up. Menus, packaging, shop windows, the back of business cards, conference slides that live online forever. The subscription is cheap. Reprinting isn't. And whoever scans a dead code doesn't blame the QR company, they blame you.

Even owning the domain only helps if you hang on to it, which is where Xerox comes in. BleepingComputer reported on 1 December that Xerox is replacing QR code labels on printers across the UK. The labels came from Arena Group, which Xerox bought in 2020, and pointed at an Arena support domain. That domain was left to expire, someone else registered it in October, and now the codes lead to an adult site. Nobody hacked anything. The stickers are just doing what they were printed to do. Heinz had almost exactly the same problem with ketchup bottles in Germany back in 2015.

"But Gerry, you've built yours on Cloudflare"

Yes, I know. Telling people not to rely on third parties and then building the whole thing on Cloudflare isn't lost on me.

The difference is the domain. Every code I print points at qr.dergal.co.uk, which is mine. Cloudflare runs the bit that does the redirecting, but it doesn't own the link. If Cloudflare tripled its prices tomorrow, I could rebuild the redirects somewhere else in a few days, point the DNS at the new setup, and every code I've ever printed would keep working. Nobody scanning one would know anything had changed.

What caught me out

A few things I didn't expect, in case you try this yourself:

  • LinkedIn doesn't like being checked. It sends automated requests a status code of 999, which isn't even a real HTTP status. My link checker now treats that, along with 403s and 429s, as "can't verify" rather than broken, otherwise my LinkedIn link would be permanently red.
  • Location data is rough. My first test scan, from London, was logged as Chelmsford. City-level location from an IP address is a best guess, so I treat country as reliable and city as a vibe.
  • Cloudflare can get in its own way. I tried serving the screenshots for this post from the same subdomain, and anything ending in .png got grabbed by Cloudflare's image handling before it reached my code. Dropping the file extension fixed it. No idea why I expected that to be simple.

What does it cost?

Nothing so far, and probably nothing for a long time. Each scan is one request to the Worker and one row written to the database. Cloudflare's free plan allows 100,000 of each a day, which is around 3 million scans a month.

If you outgrow that, Workers Paid starts at $5 a month and includes 10 million requests (then $0.30 per million) and 50 million database writes (then $1 per million). Storage is 5 GB on both, and there's no charge for bandwidth. The full numbers are on Cloudflare's Workers and D1 pricing pages.

The free limits reset at midnight UTC. Go over the request limit and redirects stop working until then, so if you're about to put a code on national packaging or a TV ad, pay the $5. Go over the database limit and you only lose the tracking, because the click is saved after the person has already been sent on their way. The limit you're most likely to notice first is actually the dashboard, since every view reads back through the stored clicks. That only bites once you've got hundreds of thousands of scans stored.

Where could you take it?

Once every scan goes through code you control, you can start making decisions with it. Mine already sends people to different places depending on their phone, their country or the date. So an iPhone can go to the App Store and an Android phone to Google Play, someone in Ireland can land on euro pricing, and the code on a conference flyer can switch from the agenda to the recordings the morning after the event.

Three rules on one link: iPhones, visitors from Ireland, and anyone scanning after the event.

The obvious next step is split testing, sending half the scans to one page and half to another. That's where it gets interesting for anyone who prints a lot:

  • A meal kit company could test whether the QR code on a recipe card works better pointing at a video or at written steps, and measure it in reorders rather than clicks.
  • A restaurant could change what the table QR code shows depending on whether it's lunch or dinner, without reprinting anything.
  • An estate agent could test whether a for sale board does better sending people to the listing or straight to booking a viewing.
  • An author could test the back page of a book: next book in the series, or newsletter sign-up?

Add UTM parameters to each destination and the scans show up properly in GA4 too. If you want to catch the people who bounce before your analytics tag fires, the Worker can send the scan to GA4 server-side as well.

Before you print another QR code

Even if you never build anything like this, it's worth checking a few things:

  • Does the code point at a domain you actually own? If it points at a QR generator's domain, you're renting it.
  • Will you still own that domain for as long as the printed thing exists? Campaign microsites and domains that came with an acquisition are the ones that get forgotten.
  • Is it on auto-renew, with a card that won't expire and renewal emails going to someone who still works there?
  • When a campaign finishes, does the link redirect somewhere sensible?
  • Is anyone checking, now and again, that each printed code still lands on a working page?

If you want a hand setting up something like this, or checking what's out there with your name on it, give me a shout. I'm always happy to chat about this sort of thing.

Sources

Gerry, Amanda and Patrick
By Gerry White • November 25, 2026
Notes from my Sitebulb webinar with Amanda King and Patrick Hathaway: how AI is changing enterprise SEO, from log files and Copilot to agentic commerce.
Vintage brass compass on an old nautical map
By Gerry White • November 13, 2026
Why AARRR pirate metrics fit GEO and AI search far better than classic SEO, and how to track each stage with prompts, GA4, server logs and reviews.
By Gerry White • October 19, 2026
A step-by-step guide for marketers: build a free WhatsApp bot that answers from your own website, logs chats to Google Sheets and hands over to a human.
By Gerry White • October 18, 2026
I built a free WhatsApp FAQ bot for Dergal with Cloudflare Workers and the WhatsApp Cloud API. How it works, plus every mistake I made.
By Gerry White • April 14, 2026
Most of us have developed a reflex: privacy policy appears, thumb moves to "Accept", life continues. We do it on websites, apps, and now, apparently, televisions. But recently, while setting up a new Samsung TV, something stopped that reflex in its tracks. The list of "partners" the TV intended to share data with was 263 companies long. In the video I know I said 400, but still, 263 is far hight than I was expecting That moment of "privacy shock" — feeling invaded in your own living room — is worth unpacking properly. Because the real issue isn't whether you clicked accept. It's whether any of us genuinely understand what we're accepting, why it exists, and whether our collective response to it is calibrated correctly. So what actually is a cookie? Cookies started life as a genuinely useful piece of web plumbing. In 1994, Netscape engineer Lou Montulli invented them to solve a basic problem: websites had no memory. Every page load was a blank slate. Cookies gave sites a way to remember you — your shopping cart, your login, your preferences. A cookie is simply a small text file. A website writes it to your browser; your browser sends it back every time you return to that site. That's it. At their most innocent, they're the reason you don't have to log back into Gmail every twenty minutes. The complication comes in two flavours. First-party cookies are set by the site you're actually visiting and are broadly benign. Third-party cookies are set by someone else — an advertiser, an analytics provider, a social media widget — embedded on that page. These can follow you across the internet, building a profile of your behaviour across hundreds of sites you've never consciously engaged with. On a smart TV, there are no traditional cookies — but the principle is identical. Your viewing habits, your app usage, the content you pause, rewind, or abandon — all of it becomes data. And that data travels. The four types of cookie (in plain language) Strictly necessary Keeps you logged in. Remembers your basket. Non-negotiable for a working site. Functional Saves your preferences — language, region, layout. Useful, low-risk. Analytics Tells the site owner how pages are used. Can be anonymised — often isn't. Advertising / targeting Builds a profile of you. Shares it. Follows you around the web. This is the one. Are we panicking about the wrong thing? Here's the honest tension: most people are simultaneously over-informed and under-informed about cookies. They know they exist, they've been conditioned to feel vaguely threatened by banners, and they've developed coping strategies — clicking accept as fast as possible to make the banner disappear. That's not privacy-conscious behaviour. That's banner fatigue wearing a privacy-conscious costume. The genuine concern isn't that a website knows you visited it twice this week. It's the aggregation: dozens of data brokers combining your TV viewing, your web browsing, your location data, your purchase history, and your search behaviour into a single commercial profile that you never consented to and can't easily inspect. Meanwhile, real risks go unnoticed. People use the same password everywhere, click phishing links in emails, and connect to public Wi-Fi without a VPN — yet feel virtuous about occasionally clicking "reject all" on a cookie banner. The 400-partner list on a Samsung TV is extreme, but it's a useful data point. It illustrates that the modern "consent" model is largely theatrical. No one is reading 400 partner policies. The consent architecture is designed to be accepted, not interrogated. GDPR tried to address this; the results have been mixed at best. What can you actually do? On smart TVs specifically: dig into the privacy settings menu rather than accepting the onboarding prompt. Most Samsung and LG TVs have an "interest-based advertising" toggle buried several menus deep — turn it off. Disable ACR (Automatic Content Recognition) if you can find the setting; this is the technology that monitors what you're watching in real time. On the web: a browser extension like uBlock Origin blocks the trackers that cookie banners are trying to legitimise. Choosing "reject all" on cookie banners, where that option is clearly presented, takes thirty seconds and meaningfully reduces your third-party data trail. More broadly: understand the difference between the data you're comfortable sharing (anonymous usage stats, session preferences) and the data that builds a profile of you (cross-site behavioural tracking, location, purchase intent). Make decisions at that level, not at the level of individual banners.
By Gerry White • March 17, 2026
Google, the AI Race and the Organic Traffic Price
By Gerry White • July 28, 2025
Short answer, no
Buzz word bingo
By Gerry White • July 28, 2025
When we keep changing what we call ourselves, we're essentially telling the world that our previous work was wrong or outdated. That's nonsense. The technical SEO work I did ten years ago is still serving websites well today. The content strategies that worked in 2015 are still driving traffic and conversions.
By Gerry White • July 27, 2025
This is a subtitle for your new post