Case Studies8 min readJuly 16, 2026

Decathlon 'Deal-cathlon AR Hunt': An In-Store WebAR Treasure Hunt

How Code Crush turned a Decathlon Vietnam gamification brief into a working WebAR treasure hunt — a catch mini-game, a 200m GPS geofence, and a real camera + gyroscope AR hunt that drives online players into physical stores. The build, the tech, and the honest limits.

Code Crush Team

Gamification Agency

Decathlon Deal-cathlon AR Hunt — a live camera WebAR treasure hunt inside a Decathlon store

The Project

The Deal-cathlon AR Hunt is the first of two gamification concepts Code Crush prototyped for Decathlon Vietnam's 50th-anniversary campaign. It is an online-to-offline treasure hunt: players qualify from their phone, then have to physically show up at one of five Decathlon stores during a "Grand Event Hour" (Giờ G) to hunt down and claim a real prize.

Everything below is a live, playable web app — built in Next.js, no app install, deployed to Google Cloud Run. It runs the full flow end to end: catch game → access pass → store pick → GPS check-in → camera AR hunt → prize draw → in-store redemption.

The landing screen. A player arrives during the pre-launch window and is pushed straight into the qualifying mini-game.
The landing screen. A player arrives during the pre-launch window and is pushed straight into the qualifying mini-game.

The Brief

Decathlon's ask (from the campaign pitch deck) was direct:

Connect the online audience to the point of sale. Drive real foot traffic into stores, capture CRM data, and make it shareable — not just another spin-to-win.

The mechanic they outlined was a five-step journey:

1Discovery — visit the site during the pre-launch window.
2Quick-Hands Challenge — a catch mini-game, one attempt per day, that gates an Access Pass.
3Choose Hunt Point — lock the pass to 1 of 5 stores.
4Hunt-Time Check-in — show up in the right window, prove you're there, trigger a reward draw.
5Redemption — hand a code to staff, get the prize on the spot, CRM updated.

The hard part is step 4. "Prove you're there" is what separates a real footfall driver from a coupon anyone can claim from their sofa.

How Code Crush Answered It

We built the whole journey as a single, fast state machine and made each step feel like a distinct, branded moment.

1. The catch mini-game. Deal tiles fall; you tap to catch them. A 35-second round, a speed boost at 10 catches, and a score threshold of 15 to earn a pass. Capping it at one attempt a day is what keeps the pass scarce.

"Grab It Before It's Gone" — the qualifying catch game. Score 15+ in 35 seconds to earn an Access Pass.
"Grab It Before It's Gone" — the qualifying catch game. Score 15+ in 35 seconds to earn an Access Pass.

2. The Access Pass. Win, and you get a barcoded pass with a live countdown to your store's event window. It's saved to the device, so players can close the tab and come back — the pass (and its countdown) is still there.

The Access Pass — persisted locally, resumable, and locked to a single store for the event.
The Access Pass — persisted locally, resumable, and locked to a single store for the event.

3. Pick your store. Five real Decathlon Vietnam locations, each with its floor area and the shared Giờ G (5PM Thursday) window.

Choosing the hunt store. The pass locks to whichever store you pick.
Choosing the hunt store. The pass locks to whichever store you pick.

4. The check-in — a real 200m geofence. This is our answer to "prove you're there." Before the hunt unlocks, the app asks for GPS and checks you're within 200 metres of the store you chose. Too far, and it tells you exactly how far off you are.

5. The AR hunt. Inside the radius, the phone's rear camera opens and drops are hidden in 3D space around you. You physically turn to find them, following a radar that runs warmer as you get closer, then tap to collect.

The live camera AR hunt. Drops are anchored in 3D around the player; the radar points to the nearest one. Turn the phone to find it, tap to catch.
The live camera AR hunt. Drops are anchored in 3D around the player; the radar points to the nearest one. Turn the phone to find it, tap to catch.

6. The reward draw & redemption. Bagging the grand drop opens a weighted prize draw from a fixed pool of exactly 50 prizes per store ("50 Đặc Quyền Tuổi 50"), then produces a redemption ticket the player shows to staff — and can save to their phone as an image.

The reward draw. A fixed 50-prize pool per store, weighted by how many of each remain.
The reward draw. A fixed 50-prize pool per store, weighted by how many of each remain.
The redemption ticket — a barcode plus a "save to phone" export rendered on a canvas.
The redemption ticket — a barcode plus a "save to phone" export rendered on a canvas.

How We Coded It

Stack: Next.js 15 (App Router), a single client-side state machine driving every screen, deployed as a standalone container on Google Cloud Run (Singapore region, scale-to-zero).
Catch game: a `requestAnimationFrame` loop spawns and drops tiles; catching is a tap with a deliberately generous hit area so fast-moving targets still feel fair on a touch screen.
Access Pass: persisted to `localStorage` with a live countdown, so the pass survives a refresh and stays locked to its store.
Geofence: `navigator.geolocation` + a haversine distance to the chosen store's coordinates, gated at 200m, with a graceful "preview anyway" path so the demo is explorable off-site.
The AR: the real headline. A live rear-camera feed sits behind a transparent Three.js WebGL layer whose camera is driven by the device's `DeviceOrientationEvent` — so physically turning the phone looks around the scene. Drops are 3D billboards placed far out on a sphere and revealed one at a time; a tap raycasts against the active drop. When there's no camera or motion sensor (e.g. desktop), it falls back to a drag-to-look demo so the link never shows a broken screen.
Redemption ticket: drawn to an HTML `` and exported as a PNG the player can save.
Responsive: a framed phone mockup on desktop for pitching, full-bleed on real phones.

The Limits (and the honest trade-offs)

We think being clear about the edges is part of the job:

WebAR is look-around, not world-tracking. A browser can't run ARKit-grade plane detection, so drops are anchored to the player's heading (via the gyroscope), not pinned to a specific shelf. It reads as AR and needs no app install — the trade for that reach is no true world anchoring.
GPS alone can be spoofed. A 200m geofence is a strong soft gate, but for a real prize event it should pair with the in-store QR scan the brief already specifies — the QR is the un-spoofable "you're really here" check; GPS is the friendly first filter.
iOS needs a tap to grant camera + motion. Both permissions must be requested from a user gesture, so the hunt always starts behind an explicit "Enable camera AR" button.
Web game loops pause in the background. Like any `requestAnimationFrame` game, the falling-deals loop sleeps when the tab is backgrounded — expected behaviour, not a bug.

Why It Works for Decathlon

The whole point is the walk to the store. Qualifying online is fun, but the pass is worthless until you're standing inside a Decathlon during Giờ G — and the GPS gate plus camera hunt make "being there" the actual game. That's footfall you can measure, first-party data at redemption, and a shareable moment, all from a link.

This is one of two concepts from the pitch. Its sibling — a shareable social AR face-filter game — is written up in Decathlon "Deal Frenzy / Cơn Lốc Deal": A Shareable WebAR Face-Filter Game.

Prototype designed and built by Code Crush as a concept for Decathlon Vietnam. Store data, prizes, and event timing are illustrative.

Tagged with

case studyDecathlonWebARAR treasure huntgeofencingThree.jsNext.jsonline to offlineVietnam
Free Newsletter

Get Gamification Insights Delivered Weekly

Join brand managers and marketers getting our best content on branded games, engagement strategies, and interactive marketing — no spam, unsubscribe anytime.

No spam. Unsubscribe anytime. We respect your inbox.

Let's Build Something Your Audience Will Love

From branded games to immersive 3D experiences — we bring engagement to life.