How to Track QR Codes with GA4: The Actionable Implementation Guide
Introduction: Connecting Offline to Online
The challenge in modern marketing is connecting offline activity (like a QR code scan) to online results in Google Analytics 4 (GA4). This guide cuts straight to the technical setup, giving you the precise steps to measure the ROI of every QR code placement.
Section 1: The Core Requirement — UTM Parameters
A QR code is just a link. To make it trackable, you must append UTM (Urchin Tracking Module) parameters to the destination URL. GA4 uses these parameters to populate your Traffic Acquisition reports.
Adopt a consistent naming convention for these three parameters. This consistency is the single most important element for clean data.
Table 1: Your Essential QR Code UTM Strategy
Section 2: Implementation — Building and Deploying the Link
Step 1: Build the Full, Tagged URL
Use a tool like the Google Campaign URL Builder to combine your destination URL with your planned UTM values.
Step 2: Shorten the URL
You must shorten the tagged URL using a service like Bitly or Rebrandly before generating the QR code.
Why? Long URLs create complex, dense QR codes that are difficult for phones to scan. Always shorten your final tagged URL, and use that shortened version when generating your QR code.
Step 3: Generate and Test the QR Code
Use your preferred QR code generator tool, ensuring it uses the shortened, tagged URL. Test the QR code on at least three different mobile devices (iOS and Android) before deployment.
Section 3: GA4 Setup — Making UTMs Reportable
While GA4 automatically collects UTM data, you must register them as Custom Dimensions to use them in advanced reports such as Explorations or as secondary dimensions.
Actionable: Create Custom Dimensions
Navigate to GA4 Admin → Property → Custom Definitions → click Create custom dimensions, and fill out as shown below. Set the Scope to Event.
Section 4: Validation and Analysis
Validation with DebugView
Before printing, use DebugView to confirm your data flow:
- Enable Debug Mode (use browser extension or GTM preview mode).
- Scan your QR code.
- Go to GA4 → Admin → DebugView.
- Check the
page_viewandsession_startevents for parameters:medium = qrcode_scan, and yoursourceandcampaignvalues.
Where to Find the Data
- Traffic Acquisition Report: Change the primary dimension to
Session source / medium, and filter for
qrcode_scan. - Explorations: Use your custom dimensions (QR Source, QR Campaign) to build funnel or free-form reports.
Section 5: Key Best Practices Checklist
- Consistency: Always use one value for
utm_medium(e.g.,qrcode_scan). - URL Shortener: Mandatory for scannability.
- No PII: Never include personal data (emails, names) in URLs.
- Test on Mobile: Always test code scannability and landing page responsiveness.
Conclusion: Measuring Offline ROI with GA4
By following these core steps, you can immediately start measuring the precise contribution of your physical marketing materials within GA4 — from flyers to packaging — and confidently attribute offline scans to digital results.