惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
博客园 - 叶小钗
量子位
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Privacy & Cybersecurity Law Blog
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
雷峰网
雷峰网
C
Cybersecurity and Infrastructure Security Agency CISA
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
美团技术团队
T
Tenable Blog
T
Threatpost
S
Security Affairs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cisco Blogs
The Last Watchdog
The Last Watchdog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
A
Arctic Wolf
Attack and Defense Labs
Attack and Defense Labs
AWS News Blog
AWS News Blog
AI
AI
W
WeLiveSecurity
H
Help Net Security
G
Google Developers Blog
PCI Perspectives
PCI Perspectives
博客园_首页
S
Securelist
B
Blog RSS Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Forbes - Security
Forbes - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
Lohrmann on Cybersecurity
云风的 BLOG
云风的 BLOG
Martin Fowler
Martin Fowler
C
CERT Recently Published Vulnerability Notes
H
Hacker News: Front Page
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Spread Privacy
Spread Privacy
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
博客园 - 司徒正美
Google Online Security Blog
Google Online Security Blog
T
The Blog of Author Tim Ferriss

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Track QR Code Scans in GA4 Without Losing Attribution
Nacho Gonzál · 2026-05-07 · via DEV Community

You launch a print campaign. Posters go up, menus get new QR codes, product packaging ships with a fresh scan prompt. Two weeks later you open GA4 to measure performance and see a spike in direct traffic. No campaign, no source, no medium. Your QR scans are in there somewhere, mixed in with people who typed your URL by hand. This is the default behavior for QR code GA4 tracking, and it will keep breaking attribution on every physical campaign you run until you fix it.

TL;DR

  • QR scans arrive in GA4 as direct traffic because phones send no HTTP referrer when opening a URL from a camera app.
  • The fix is always-on UTM tagging: every QR destination URL needs at minimum utm_source, utm_medium, and utm_campaign.
  • GA4 has no built-in QR channel — create a custom channel group so tagged QR traffic is not bucketed as "Unassigned."
  • Use a consistent lowercase naming convention or your data fragments into separate line items that look like different sources.
  • QR platform analytics and GA4 serve different purposes — use both, not one or the other.

Why QR codes break GA4 attribution

Key concept: GA4 classifies every session by traffic source. When no UTM parameters and no HTTP referrer are present, GA4 defaults to "direct / (none)." That is exactly what happens with every untagged QR code scan.

GA4 identifies traffic source from two places: UTM parameters in the URL and the HTTP referrer header sent by the browser. Click a link on a webpage and that page's URL gets passed along as the referrer. Click an email link and the email client usually strips the referrer, which is why email marketers have been tagging URLs with UTM parameters for years.

QR codes are the same problem, only worse. Someone scans a QR code and their phone opens the URL in a fresh browser tab. No previous page to reference. No referrer sent. GA4 sees an empty source and files the session under "direct / (none)."

Every untagged QR campaign you run inflates your direct traffic number and vanishes from campaign reports. You cannot prove which placement drove visits, which campaign generated conversions, or whether your print spend was worth a dime.

The foundation: UTM parameters for QR campaigns

UTM parameters are query string tags appended to a destination URL. GA4 reads them on arrival and stores them as session-scoped dimensions, overriding whatever referrer data the browser would have sent. For QR codes, UTMs are not optional. They are the only attribution signal you have.

The five UTM parameters

  • utm_source — Where the traffic originates. For QR codes, use qr as a standard value across all campaigns. This makes it easy to create a single GA4 channel rule that captures all QR traffic regardless of format.
  • utm_medium — The channel type. Options include offline, print, packaging, outdoor, event. Pick the one that reflects the physical format.
  • utm_campaign — The campaign name. Keep it descriptive and lowercase: summer_menu_2026, trade_show_april, product_launch_q2.
  • utm_content — The specific placement within a campaign. utm_content=lobby_poster versus utm_content=table_card versus utm_content=receipt_footer gives you placement-level data inside a single campaign.
  • utm_term — Skip it for QR campaigns. It was designed for paid search keyword tracking and adds noise without value in an offline context.

A practical QR UTM URL structure

A properly tagged URL for a restaurant running a summer menu campaign:

https://example.com/menu?utm_source=qr&utm_medium=print&utm_campaign=summer_menu_2026&utm_content=table_card

Enter fullscreen mode Exit fullscreen mode

Same campaign, different placement:

https://example.com/menu?utm_source=qr&utm_medium=print&utm_campaign=summer_menu_2026&utm_content=entrance_poster

Enter fullscreen mode Exit fullscreen mode

In GA4, these sessions show up in Traffic Acquisition under source qr, medium print, campaign summer_menu_2026. Break down by utm_content to see which placement drove more scans or deeper engagement.

One rule: always use lowercase

GA4 is case-sensitive for UTM parameter values. utm_source=QR and utm_source=qr show up as two different sources. Pick your values, document them, enforce them. This is far and away the most common UTM mistake in practice.

Setting up GA4 to recognize QR traffic

Even with perfect UTM tagging, GA4 will not know what to do with sessions where session_source = qr and session_medium = offline. The default channel grouping has no rule for these values, so they land in "Unassigned." You need a custom channel group.

Step 1: open channel group settings

Go to GA4 Admin and select your property. Under Data Display, click Channel Groups. Click Create new channel group.

Step 2: create the QR code channel

Name your channel group "QR Campaigns" or copy the default channel group and add a new channel. Click Add new channel and name it "QR Code." Set the rule condition:

  • Dimension: Session source
  • Condition: exactly matches
  • Value: qr

If your team already uses multiple source values, add multiple conditions with OR logic.

Step 3: position the rule correctly

GA4 evaluates channel rules from top to bottom and stops at the first match. Place your QR Code channel above the broad catch-all rules like "Unassigned" or "Direct" so QR sessions are claimed before they fall through to a default bucket.

Step 4: save and publish

Click Save. One caveat: this rule is not retroactive. Sessions collected before you created it stay where they are.

Verifying it works

Use GA4's Realtime report to test right away. Scan one of your tagged QR codes on your phone and watch the active users report. Within a few seconds the session should appear with the correct source, medium, and campaign. If you see direct traffic instead, a redirect probably stripped the UTM parameters.

Where UTM tags break: redirects and dynamic QR codes

URL redirect chains trip up even experienced marketers. If your tagged URL goes through a redirect that strips query parameters, the UTM values disappear before they reach the landing page.

The typical failure: you tag a URL, shorten it, and the shortener's redirect does not preserve query strings. The user lands on your page with a clean URL and GA4 records a direct session. Test every redirect in your chain before printing anything.

Dynamic QR codes sidestep this. Instead of encoding a long UTM-tagged URL directly, the QR code points to a short redirect URL managed by your QR platform. The platform redirects to your destination with UTM parameters intact and lets you change the destination URL later without reprinting. For long-running campaigns, that flexibility alone is worth the switch.

QR platform analytics vs. GA4: use both

These tools track different things, and you need both.

A QR platform captures scan-level data: total scans, unique scans, device type, OS, location by country and city, time-of-day patterns. All of this is recorded the moment someone scans, before they reach your website. It tells you how many people scanned and where.

GA4 picks up after the landing page loads. Pageviews, events, conversions, session duration, goal completions. It tells you what scanners did once they arrived and how many converted.

A QR campaign might show 400 scans in the platform dashboard but only 220 sessions in GA4. That gap is real: users who bounced before the GA4 script fired, or users on devices with JavaScript disabled. Comparing scan data against session data is the only way to understand drop-off at the scan-to-landing-page step.

Five attribution mistakes that kill QR campaign data

1. No UTM parameters at all

The most common one, and the most painful. Every QR code destination URL must be tagged. No exceptions. If you already have QR codes printed on materials without UTM parameters, that attribution data is gone. You cannot recover it.

2. Tagging internal links

Adding UTM parameters to links between pages on your own website overwrites the session source mid-visit. A user arrives from your QR code, clicks a UTM-tagged internal banner, and GA4 reassigns the session to the banner as the source. Keep UTM parameters on external-to-your-site links only.

3. One generic QR code per campaign

Same tagged URL across five different placements means five placements sharing one line item in GA4. Worth creating a unique QR code for each placement, even if it takes a few extra minutes.

4. Inconsistent naming across campaigns

Someone on your team launches a new campaign with utm_source=qr-code while every previous campaign used utm_source=qr. Now you have a separate source row in GA4 that cannot be merged after the fact. A shared UTM naming doc, reviewed before each launch, prevents this.

5. Not testing before print

Printing 10,000 flyers with a broken QR code is an expensive lesson. Scan your QR code with GA4 Realtime open before sending anything to print. Confirm the UTM parameters survive every redirect in the chain.

Building a QR attribution report in GA4

With tagging and the channel group in place, build a focused QR campaign report in Explore using a free-form exploration.

Dimensions to include:

  • Session campaign — separates individual campaigns
  • Session source / medium — confirms QR sessions are properly tagged
  • Session manual ad content — surfaces your utm_content placement data
  • Landing page + query string — useful for catching untagged QR sessions that slipped through

Metrics to include:

  • Sessions
  • Engaged sessions
  • Engagement rate
  • Key events (conversions)
  • User engagement duration

Filter the exploration to Session source exactly matches qr to isolate QR traffic. Save it once and revisit across campaigns without rebuilding.

Conclusion

QR code attribution in GA4 is not a platform limitation. It is a setup problem you can solve in an afternoon. Tag every destination URL with consistent UTM parameters, create a custom channel group so GA4 knows what to do with that traffic, and test before you print. Those three steps recover attribution that most marketers are losing to the direct channel bucket right now.


Originally published on QR Nova