The problem
Drink Caveman sells coffee on Shopify and runs Meta ads and Klaviyo email flows. The brand wanted to send that paid and owned traffic to a bundle offer that the rest of the internet could not find: not in navigation, not in search, not discoverable by someone typing the collection URL, and not indexed by Google. Once a visitor was in, the page should have nothing to click except add-to-cart and checkout.
Shopify does not offer that. A collection is either published or it is not, and a password-protected store locks out everyone. Landing-page apps solve the layout but not the access control, and they cannot reach into the cart and checkout. The live theme, meanwhile, was carrying real revenue and could not be edited in place.
What the store needed
- Access control that cannot be guessed: Links that prove where a visitor came from, expire on a schedule, and can be invalidated.
- A funnel with no exits: Bundle page, cart, checkout. No header, no footer, no product detail pages, no search.
- Zero risk to the live store: Nothing pushed to the published theme until an explicit sign-off.
- Repeatable: The same pattern for the next campaign, the next page and the next store.
How it works
The token
A token is a base64url payload carrying a version, a campaign name, an expiry timestamp and a random nonce, followed by an HMAC-SHA256 signature over that payload. A command-line tool mints one for a named campaign with a lifetime in days: 30 days for a Meta ad set, 365 for the evergreen link in Klaviyo flows, one day for a smoke test. A companion tool verifies any full URL. Ten unit tests on the Node test runner cover the acceptance and rejection cases: valid, expired, wrong secret, tampered payload, no separator, empty, null, missing campaign, unknown version, and that the TTL is reflected in the expiry.
The Worker
The ad or email link points at a Cloudflare Worker's verify route with the token and UTM parameters. The Worker checks the signature, version, expiry and campaign field. On success it sets a signed session cookie and answers with a 302 to the bundle collection on the store, appending a flag and passing the UTMs through. On failure, whether expired, forged or replayed, it 302s to the homepage. A separate check route reports whether the visitor holds a valid cookie, kept available as a fallback path. The Worker runs on a workers.dev subdomain, so the store's DNS was never touched, and staging and production Workers are deployed under separate names.
Funnel mode in the theme
The live theme was duplicated and the duplicate received a single, delimited block in the head of the theme layout. Guarded by Liquid conditionals, it has no effect anywhere outside the funnel. When the redirect flag is present, an inline script sets a sessionStorage marker and adds a class to the root element; every page in that tab then renders in funnel mode. Scoped CSS hides the desktop header, footer, app-injected announcement bars, cart and size-guide drawers, quiz overlays and search, while leaving the mobile nav bar with only a hamburger and a cart icon. The bundle link is hidden from every navigation menu site-wide and the collection is disallowed in robots.txt with a noindex meta tag.
On the cart page, the same class hides the chrome and the redundant update button, and quantity buttons are intercepted so each change posts to the cart API and reloads, keeping the visible subtotal accurate. Checkout is the only remaining exit.
What shipped
Problems worth talking about
The iOS freeze
One pixel, one event
App bars that fight back
Rollback is one click
Verification
The deployment report from 12 May 2026 records the results. Ten of ten unit tests pass. The manual QA matrix on the staging theme passed all twelve checks: a valid token renders the funnel, a missing or garbage token redirects home, the token disappears from the URL while UTMs are preserved, a reload on the cookie still renders, the homepage is untouched for organic visitors, every escape path is blocked, add-to-cart lands on the cart page, quantity and removal work, checkout completes, a real mobile device passes, and the pixel fires once per event. A test purchase was placed and refunded, and the Klaviyo path was exercised end to end from a real inbox. Playwright drives the same flow at a 390 by 844 viewport for regression checks, with a real-device iOS pass required after it.
The playbook
The store-specific values are tabulated in one place: the gated path, the fallback URL, the origin host, the header section selector, the URL flag convention. The runbook explains how to gate a second page, when to re-duplicate the theme after a live-theme change, and what shipping changes do and do not require. The generalised procedure was extracted into a separate gated-URL playbook so the same pattern can be applied to any Shopify store.
Where it stands
What we can and cannot claim
The funnel was built, staged and verified in May 2026 and is production-ready pending the client's sign-off to publish the duplicate theme; until then, the staging Worker serves the links. The test counts above are taken from the deployment report and the test suite. Wiring the provisioned KV namespaces for rate limiting and per-campaign revocation is a documented next step. We have no ad-account or store analytics access for this client, so this page carries no ROAS, session or revenue figures.
If any verification step fails, stop and report. Do not fix and continue without explicit human approval.
— Agent execution checklist, drinkcaveman.com
What This Project Does Well
Technologies Used
Shopify (Liquid theme, cart AJAX API), Cloudflare Workers and Wrangler, Workers KV, HMAC-SHA256 via Web Crypto, Node.js 18+ CLI tooling (mint, verify, preflight), Node test runner, Klaviyo, Meta Ads and Meta Pixel, Playwright end-to-end verification, Shopify CLI
Ready to Build Something Similar?
Let's discuss how we can help transform your business with a custom digital solution.
