Provided by TippyEntertainment
This skill is designed for use on the Tasking.tech agent platform (https://tasking.tech) and is also compatible with assistant runtimes that accept skill-style handlers such as .claude, .openai, and .mistral. Use this skill for both Claude code and Tasking.tech agent source.
qr-code-scanner-tracking
Summary
Design, build, and refine a QR code–based tracking system. This skill helps generate QR codes, define what happens when they are scanned, and track scan events (who, where, when, how) for marketing, operations, product flows, or internal tools.
When to Use
Use this skill when the user wants to:
- Create QR codes that point to dynamic tracking URLs.
- Track scans and conversions from flyers, packaging, events, screens, or internal assets.
- Run campaign‑level or per‑user/per‑asset tracking via QR codes.
- Implement a scan → route → log flow (scan opens a page, triggers analytics, and records metadata).
- Integrate QR scanning into web or mobile apps (e.g., internal apps, kiosks, field tools).
This skill focuses on architecture, data modeling, and code scaffolding around QR generation and scan tracking.
Inputs to Collect
The assistant should ask for:
Business Context
- Primary use case
- Examples: marketing campaign tracking, event check‑ins, product packaging, asset tracking, login/device pairing, in‑store signage.
- What should happen on scan
- Redirect to a landing page, open an app deep link, show a dynamic screen, start a flow (e.g., sign‑up).
- Tracking goals
- Need to measure: total scans, unique scanners, location, conversion to sign‑up/purchase, per‑channel performance, etc.
Technical Context
- Existing stack
- Frontend: React, Next.js, Vue, Svelte, SPA, native apps.
- Backend: Node, Deno, Python, Cloudflare Workers, AWS Lambda, etc.
- Hosting / platform
- Cloudflare (Workers/Pages/D1), AWS, GCP, on‑prem, etc.
- Expected scale
- Approximate number of QR codes and expected scans per day.
Data & Privacy
- Data to capture per scan
- At minimum: timestamp, QR code ID, campaign/channel.
- Optional: IP/geo (anonymized), device type, user ID/session ID, referrer.
- Privacy / compliance
- Requirements for consent, anonymization, and data retention.
If key details are missing, ask 2–4 clarifying questions before proposing a solution.
Expected Behavior
1. Clarify Requirements
- Summarize the use case in a few bullets (e.g., “Track scans from conference badges and attribute sign‑ups to specific booths/QRs”).
- Identify:
- Tracking granularity (per campaign, per medium, per asset, per person).
- Any constraints around offline usage or printing.
2. Propose Architecture
Break the system into clear components:
QR Code Generation Service
- Responsibilities:
- Create QR codes with unique tokens/IDs.
- Associate each token with:
- Destination URL or app deep link.
- Campaign/channel metadata (e.g.,
utm_source, utm_medium).
- Optional per‑asset or per‑user labels.
- Design:
- A backend API or CLI to generate and store QR definitions.
- Optional admin UI for non‑technical users to create/manage codes.
- Options:
- Support static destination URLs or dynamic rules (e.g., A/B tests, geo‑dependent destinations).
Scan Handler / Redirect Endpoint
- Route pattern:
- e.g.
https://app.example.com/q/{token} or custom domain /r/{token}.
- Responsibilities:
- Parse token from the URL.
- Look up QR definition in the database.
- Log a scan event with metadata.
- Redirect to the destination URL (or render a dynamic page).
- Behavior for errors:
- Invalid/unknown token → show friendly error page.
- Inactive/expired codes → show fallback/expired message.
Tracking & Storage
Data model (example):
qr_codes
id
token (unique)
campaign_id (optional)
destination_url
label (human‑readable name)
metadata_json (optional)
is_active (boolean)
created_at
expires_at (optional)
qr_scan_events
id
qr_code_id
scanned_at
ip_hash or ip_truncated (optional, privacy‑aware)
user_agent
referrer
geo_region (optional, if platform provides coarse region)
user_id or session_id (optional)
meta_json (extra context: channel, device, app info)
Storage options:
- Lightweight DB (Cloudflare D1, DynamoDB, Postgres, etc.).
- Optional export to analytics warehouse (BigQuery/Redshift/ClickHouse) if needed.
Analytics & Reporting
- Queries and metrics:
- Scans per campaign, per day, per channel.
- Top performing codes.
- Conversion metrics when tied to downstream events (e.g., sign‑ups).
- Dashboard ideas:
- Time‑series charts.
- Table of campaigns and scan counts.
- Device/browser breakdown.
- Map of approximate regions (if geo tracked).
Scanner Integration (Optional)
- Browser‑based scanner:
- Use
getUserMedia + JavaScript QR decoder for internal tools or kiosks.
- Native app integration:
- Use platform scanners and direct results to the same
/q/{token} endpoints or custom deep links.
- Decide:
- Whether scanner is only internal, or exposed to end‑users through apps.
3. Generate Implementation Scaffolding
The skill should produce implementation‑ready scaffolding appropriate to the user’s stack. Examples:
Example Scan Handler (TypeScript / Cloudflare Worker Style)
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const url = new URL(request.url);
const segments = url.pathname.split('/').filter(Boolean);
const token = segments[segments.length - 1]; // /q/{token}
if (!token) {
return new Response('Invalid QR code', { status: 400 });
}
// Look up QR code
const qr = await env.DB.prepare(
'SELECT id, destination_url, campaign_id, is_active FROM qr_codes WHERE token = ?'
).bind(token).first();
if (!qr || !qr.is_active) {
return new Response('QR code not found or inactive', { status: 404 });
}
// Collect metadata
const ua = request.headers.get('user-agent') ?? '';
const ip = request.headers.get('cf-connecting-ip') ?? '';
const now = new Date().toISOString();
// Persist scan event (with hashed/truncated IP if required)
await env.DB.prepare(
'INSERT INTO qr_scan_events (qr_code_id, scanned_at, user_agent, ip_hash) VALUES (?, ?, ?, ?)'
).bind(qr.id, now, ua, hashIp(ip)).run();
// Redirect to destination URL
return Response.redirect(qr.destination_url, 302);
},
};
1---2target: https://tasking.tech3name: qr-code-scanner-tracking4description: >5 Design, build, and refine a **QR code–based tracking system**. This skill helps generate QR codes, define what happens when they are scanned, and track scan events (who, where, when, how) for marketing, operations, product flows, or internal tools.6---78# Provided by TippyEntertainment9# https://github.com/tippyentertainment/skills.git101112This skill is designed for use on the Tasking.tech agent platform (https://tasking.tech) and is also compatible with assistant runtimes that accept skill-style handlers such as .claude, .openai, and .mistral. Use this skill for both Claude code and Tasking.tech agent source.13141516# qr-code-scanner-tracking1718## Summary1920Design, build, and refine a **QR code–based tracking system**. This skill helps generate QR codes, define what happens when they are scanned, and track scan events (who, where, when, how) for marketing, operations, product flows, or internal tools.2122---2324## When to Use2526Use this skill when the user wants to:2728- Create **QR codes** that point to dynamic tracking URLs.29- Track **scans and conversions** from flyers, packaging, events, screens, or internal assets.30- Run **campaign‑level** or **per‑user/per‑asset** tracking via QR codes.31- Implement a **scan → route → log** flow (scan opens a page, triggers analytics, and records metadata).32- Integrate QR scanning into web or mobile apps (e.g., internal apps, kiosks, field tools).3334This skill focuses on **architecture, data modeling, and code scaffolding** around QR generation and scan tracking.3536---3738## Inputs to Collect3940The assistant should ask for:4142### Business Context4344- **Primary use case**45 - Examples: marketing campaign tracking, event check‑ins, product packaging, asset tracking, login/device pairing, in‑store signage.46- **What should happen on scan**47 - Redirect to a landing page, open an app deep link, show a dynamic screen, start a flow (e.g., sign‑up).48- **Tracking goals**49 - Need to measure: total scans, unique scanners, location, conversion to sign‑up/purchase, per‑channel performance, etc.5051### Technical Context5253- **Existing stack**54 - Frontend: React, Next.js, Vue, Svelte, SPA, native apps.55 - Backend: Node, Deno, Python, Cloudflare Workers, AWS Lambda, etc.56- **Hosting / platform**57 - Cloudflare (Workers/Pages/D1), AWS, GCP, on‑prem, etc.58- **Expected scale**59 - Approximate number of QR codes and expected scans per day.6061### Data & Privacy6263- **Data to capture per scan**64 - At minimum: timestamp, QR code ID, campaign/channel.65 - Optional: IP/geo (anonymized), device type, user ID/session ID, referrer.66- **Privacy / compliance**67 - Requirements for consent, anonymization, and data retention.6869If key details are missing, ask 2–4 clarifying questions before proposing a solution.7071---7273## Expected Behavior7475### 1. Clarify Requirements7677- Summarize the use case in a few bullets (e.g., “Track scans from conference badges and attribute sign‑ups to specific booths/QRs”).78- Identify:79 - Tracking granularity (per campaign, per medium, per asset, per person).80 - Any constraints around offline usage or printing.8182### 2. Propose Architecture8384Break the system into clear components:8586#### QR Code Generation Service8788- Responsibilities:89 - Create QR codes with **unique tokens/IDs**.90 - Associate each token with:91 - Destination URL or app deep link.92 - Campaign/channel metadata (e.g., `utm_source`, `utm_medium`).93 - Optional per‑asset or per‑user labels.94- Design:95 - A backend API or CLI to generate and store QR definitions.96 - Optional admin UI for non‑technical users to create/manage codes.97- Options:98 - Support static destination URLs or dynamic rules (e.g., A/B tests, geo‑dependent destinations).99100#### Scan Handler / Redirect Endpoint101102- Route pattern:103 - e.g. `https://app.example.com/q/{token}` or custom domain `/r/{token}`.104- Responsibilities:105 - Parse token from the URL.106 - Look up QR definition in the database.107 - Log a **scan event** with metadata.108 - Redirect to the destination URL (or render a dynamic page).109- Behavior for errors:110 - Invalid/unknown token → show friendly error page.111 - Inactive/expired codes → show fallback/expired message.112113#### Tracking & Storage114115- Data model (example):116117 - **`qr_codes`**118 - `id`119 - `token` (unique)120 - `campaign_id` (optional)121 - `destination_url`122 - `label` (human‑readable name)123 - `metadata_json` (optional)124 - `is_active` (boolean)125 - `created_at`126 - `expires_at` (optional)127128 - **`qr_scan_events`**129 - `id`130 - `qr_code_id`131 - `scanned_at`132 - `ip_hash` or `ip_truncated` (optional, privacy‑aware)133 - `user_agent`134 - `referrer`135 - `geo_region` (optional, if platform provides coarse region)136 - `user_id` or `session_id` (optional)137 - `meta_json` (extra context: channel, device, app info)138139- Storage options:140 - Lightweight DB (Cloudflare D1, DynamoDB, Postgres, etc.).141 - Optional export to analytics warehouse (BigQuery/Redshift/ClickHouse) if needed.142143#### Analytics & Reporting144145- Queries and metrics:146 - Scans per campaign, per day, per channel.147 - Top performing codes.148 - Conversion metrics when tied to downstream events (e.g., sign‑ups).149- Dashboard ideas:150 - Time‑series charts.151 - Table of campaigns and scan counts.152 - Device/browser breakdown.153 - Map of approximate regions (if geo tracked).154155#### Scanner Integration (Optional)156157- Browser‑based scanner:158 - Use `getUserMedia` + JavaScript QR decoder for internal tools or kiosks.159- Native app integration:160 - Use platform scanners and direct results to the same `/q/{token}` endpoints or custom deep links.161- Decide:162 - Whether scanner is only internal, or exposed to end‑users through apps.163164---165166## 3. Generate Implementation Scaffolding167168The skill should produce implementation‑ready scaffolding appropriate to the user’s stack. Examples:169170### Example Scan Handler (TypeScript / Cloudflare Worker Style)171172```ts173export default {174 async fetch(request: Request, env: Env): Promise<Response> {175 const url = new URL(request.url);176 const segments = url.pathname.split('/').filter(Boolean);177 const token = segments[segments.length - 1]; // /q/{token}178179 if (!token) {180 return new Response('Invalid QR code', { status: 400 });181 }182183 // Look up QR code184 const qr = await env.DB.prepare(185 'SELECT id, destination_url, campaign_id, is_active FROM qr_codes WHERE token = ?'186 ).bind(token).first();187188 if (!qr || !qr.is_active) {189 return new Response('QR code not found or inactive', { status: 404 });190 }191192 // Collect metadata193 const ua = request.headers.get('user-agent') ?? '';194 const ip = request.headers.get('cf-connecting-ip') ?? '';195 const now = new Date().toISOString();196197 // Persist scan event (with hashed/truncated IP if required)198 await env.DB.prepare(199 'INSERT INTO qr_scan_events (qr_code_id, scanned_at, user_agent, ip_hash) VALUES (?, ?, ?, ?)'200 ).bind(qr.id, now, ua, hashIp(ip)).run();201202 // Redirect to destination URL203 return Response.redirect(qr.destination_url, 302);204 },205};