QR Code Tracking in Google Analytics 4: The UTM Setup Guide That Actually Works
QR Code Tracking in Google Analytics 4: The UTM Setup Guide That Actually Works
You printed 10,000 flyers with a QR code. People are scanning it. But when you open Google Analytics, that traffic shows up as direct — lumped in with people who typed your URL manually. You have no idea which flyer, which location, or which campaign drove those scans.
This is the single biggest mistake marketers make with QR codes, and it takes about five minutes to fix. Here's exactly how to set up QR code tracking in Google Analytics 4 using UTM parameters so every scan is attributed, measurable, and actionable.
Why Google Analytics Treats QR Code Scans as Direct Traffic
When someone scans a QR code, their phone opens a URL directly in the browser. There's no referring website, no search query, no click from an ad. As far as GA4 is concerned, that visitor appeared out of thin air.
GA4 categorizes any session without a referrer as direct traffic. That means your carefully planned QR code campaign gets buried alongside bookmark clicks and people who memorized your URL. Without intervention, you're flying blind.
The fix is UTM parameters — small tags appended to your destination URL that tell GA4 exactly where each visitor came from. When you encode a UTM‑tagged URL into your QR code, every scan becomes a fully attributed session with source, medium, and campaign data intact.
How UTM Parameters Work With QR Codes
UTM parameters are key–value pairs added to the end of a URL. Google Analytics reads them automatically — no extra configuration required.
There are five standard UTM parameters, but for QR code tracking, three are essential and two are optional.
The Three You Need
utm_source — Where the QR code physically lives. This is the placement identifier.
Examples:
store_windowproduct_packagingtrade_show_booth_14direct_mail_q2
utm_medium — The channel type. For QR codes, use qr_code consistently across all campaigns. This lets you create a single GA4 segment that captures all QR‑driven traffic regardless of source.
utm_campaign — The campaign name.
Examples:
spring_launch_2026loyalty_programmenu_refresh_april
The Two That Add Precision
utm_content — Differentiates variations when A/B testing. If you're testing two different QR code placements on the same poster (top vs. bottom), this is how you tell them apart.
utm_term — Less common for QR codes, but useful if you're running parallel paid search campaigns and want to distinguish QR traffic from keyword‑driven traffic.
A Real Example
Say you're running a spring promotion with QR codes on table tents in your restaurant. Your destination URL is:
https://yoursite.com/spring-menu
The tagged version looks like this:
https://yoursite.com/spring-menu?utm_source=table_tent&utm_medium=qr_code&utm_campaign=spring_promo_2026&utm_content=dessert_section
That single URL tells GA4:
- Source:
table_tent— this visitor came from a table tent. - Medium:
qr_code— they arrived via a QR code. - Campaign:
spring_promo_2026— it's part of the spring promo. - Content:
dessert_section— specifically from the dessert section placement.
No ambiguity.
Step‑by‑Step: Setting Up QR Code Tracking in GA4
Here’s the exact workflow from URL to actionable data.
Step 1: Build Your UTM‑Tagged URL
Use Google's Campaign URL Builder or build it manually.
Key rules:
- Use lowercase for all UTM values. GA4 is case‑sensitive.
QR_Codeandqr_codecreate separate entries and fragment your data. - Use underscores, not spaces. Spaces get URL‑encoded as
%20and make your reports unreadable. - Be specific with sources.
posteris useless when you have posters in 12 locations. Useposter_downtown_storeorposter_mall_entrance. - Standardize
utm_medium. Pickqr_codeand use it everywhere. Don't alternate betweenqr,QR,qrcode, andqr_codeacross campaigns.
Ready to Create Your Own QR Code?
Generate free, trackable QR codes with real-time analytics. No sign-up required.
Create Free QR Code