Up arrow
Data Analytics

How to Track QR Codes with Google Analytics 4 (GA4)

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

Parameter GA4 Report Dimension Your Required Value Rationale
utm_source Session source flyer_jan_2025, product_packaging Identifies the physical source or placement.
utm_medium Session medium qrcode_scan (MANDATORY) Sets the tracking filter. Use this value for all QR codes.
utm_campaign Session campaign spring_discount, event_boston_q3 The specific campaign or promotion name.

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.

Example of a GA4 tagged URL creation
Example
Destination: https://www.yourbrand.com/special-offer
Tagged URL: https://www.yourbrand.com/special-offer?utm_source=flyer_jan_2025&utm_medium=qrcode_scan&utm_campaign=spring_discount
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.

Example QR Code tracking setup

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.

Custom Dimension Name (GA4 UI) Scope Event Parameter (Internal Name)
QR Source Event source
QR Medium Event medium
QR Campaign Event campaign

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_view and session_start events for parameters: medium = qrcode_scan, and your source and campaign values.
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.
  • Example of a GA4 tagged URL creation

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.