Cross-Domain Tracking for QR Codes: A GA4 Setup Guide
![]()
A QR scan that lands on one of your domains and then hops to another, such as a booking page, a ticketing site or a checkout, will usually show up in Google Analytics 4 (GA4) as two unrelated visitors, and the campaign that earned the scan is lost. Fixing it takes three things: a landing URL that carries its campaign tags, redirects that keep those tags, and cross-domain measurement switched on for every domain in the journey. This guide shows each step, where it goes wrong, and how to test it before the code goes to print.
TL;DR
- GA4 can only credit a scan to a QR campaign if the URL behind the code carries UTM parameters (the tags added to a link to name its source and medium).
- Moving between two domains you own starts a new session unless cross-domain measurement is configured and the same GA4 measurement ID fires on both.
- Redirects that rebuild the URL, and domains you cannot tag, are the two most common causes of lost attribution.
- Test with the
_gllinker parameter, GA4 DebugView and Realtime before printing anything. - With a dynamic QR code, you can correct the destination after printing, so a tagging mistake does not mean a reprint.
Table of Contents
- What cross-domain tracking means for a QR campaign
- Step 1: Put the campaign in the URL you print
- Step 2: Make sure redirects keep the query string
- Step 3: Configure cross-domain measurement in GA4
- Step 4: Handle domains you cannot tag
- Step 5: Test before you print
- Why cross-domain QR tracking fails
- What this means for QR planning
- Our view: the code should outlive the setup
- Try it on your next campaign
- FAQ
- Sources
What cross-domain tracking means for a QR campaign
Analytics tools recognise a visitor through a first-party identifier stored in the browser. That identifier belongs to one domain. When a visitor moves from yourbrand.com to yourbrandevents.com, the second domain does not know who they are, so it starts a new visitor record unless the link carries the identifier across. Cross-domain tracking has to be set up on purpose for this reason.
Two cases are easy to confuse:
- Separate registrable domains, for example a main site and a standalone event or booking site. These need cross-domain measurement. A hop between subdomains of the same domain usually needs only correct cookie-domain settings and referral exclusions.
- A domain you do not control, such as a marketplace, an app store or a payment page. You cannot put your GA4 tag there, so a different approach applies (covered below).
If you can run every page of the journey under one domain, do that first. Cross-domain linking is the answer when separate owned domains have to stay separate, for example an acquired brand, a standalone event site or a hosted booking page.
QR codes add a wrinkle. A phone’s camera app opens the embedded URL with no referring page, so GA4 files an untagged scan as direct traffic. Cross-domain measurement can only carry a campaign across domains if the campaign was recorded in the first place. Order matters: tag the landing URL, protect it through redirects, then link the domains.
Step 1: Put the campaign in the URL you print
Most of the work happens before GA4 is touched. The QR code’s destination should carry UTM parameters that name the campaign. A widely used convention is utm_medium=qr with a source that names the physical placement, so a flyer, a table tent and a shop window can be told apart. GA4 cannot see a QR visit unless the URL carries these tags, and it also cannot see scans that never load the page.
A workable pattern:
utm_source: the placement, such aswindow_poster_downtownutm_medium:qrutm_campaign: the campaign name, such asspring_menu_2027
Keep names lower case and consistent, because GA4 treats QR and qr as different values. Our guide on avoiding unattributed direct traffic with UTMs walks through the naming in four moves, and a separate article on planning UTM tracking URLs shows how tagged links lift measurable results in a local-search setting.
Where it goes wrong: people tag the short link that is printed, not the final page the visitor lands on. If the short link redirects and drops the query string, the tags never reach GA4. Tag the destination, then check what survives (Step 2).
Step 2: Make sure redirects keep the query string
GA4 reads campaign parameters from the landing URL at the moment a session starts. If any redirect in the chain rebuilds the URL and drops the query string, the session has no campaign and falls into direct or unassigned.

The usual culprits are boring ones. HTTP-to-HTTPS rules, www normalisation, language detection and CDN rules can each cut everything after the question mark. Campaign URLs commonly pass through three or four hops, and print and QR campaigns nearly always use vanity URLs, which is why this class of campaign so often goes unseen, according to the same analysis.
The fixes are mechanical:
- Count the hops. Open the printed URL in a browser, watch the address bar, and list every redirect.
- Remove every hop you do not need.
- Make each remaining redirect forward the query string to the next URL.
- Where you use a vanity URL, build it as a rewrite that carries the query.
- Check the final address in the browser still shows your UTMs.
There is a second, quieter risk. GA4’s attribution looks past a direct session to earlier non-direct touches, so a stripped scan can be credited to an earlier touch such as a newsletter from weeks before. Your report will not look broken, it will look plausible and wrong. That is a stronger reason to test than waiting for a gap to appear.
Step 3: Configure cross-domain measurement in GA4
With the landing page keeping its campaign, link the domains. Google documents the path in its own help pages:
- In GA4, open Admin, then Data streams, then your web stream.
- Choose Configure tag settings, then Configure your domains.
- Add each domain that uses the tag, either by accepting Google’s recommendations or by adding match conditions, then save.
The Google tag then appends a _gl linker parameter to outbound links that point to the listed domains. The destination reads it and continues the same session and the same source.
Three conditions are easy to miss:
- One property. Cross-domain tracking works within a single GA4 property, so both domains need the same measurement ID.
- Tag on both sides. Both the sending and receiving domains must be tagged with GA4 and the destination must be explicitly listed, per this audit guide.
- Standard links only. The admin configuration does not cover form submissions that redirect, server-side 301 or 302 redirects, or JavaScript navigation.
If you run Google Tag Manager, the same domain list lives in the Google tag settings. Our article on Tag Manager for QR landing pages covers the container side for QR-specific pages.
Step 4: Handle domains you cannot tag
Sometimes the second domain belongs to someone else: a ticketing platform, a reservations tool or a payment gateway. Cross-domain tracking requires GA4 on both domains, so it does not apply. Two options exist:
- Referral exclusion. For domains you cannot instrument, list them as unwanted referrals so the return visit is not counted as a new referral from them.
- Return to a page you own. Send the visitor back to a thank-you page on your domain, where the conversion event fires. A hosted-checkout setup typically combines all three layers: cross-domain settings, unwanted-referral entries for the payment domains, and a confirmation page on your own site that fires the purchase event with de-duplication, as one Stripe walkthrough describes.
When the destination strips the _gl parameter or you cannot control it, a Tag Manager script can carry UTMs across. Analytics Mania notes that this only preserves campaign parameters, not the session, so GA4 still sees a new session and client ID on the second domain. You keep the source credit, but not the visitor’s path.
Step 5: Test before you print
Test on the real chain, starting from the real scan URL, using a phone as well as a desktop browser.
- Check the linker. Open a page that links to a configured domain, click through, and confirm the destination loads and its URL contains
_gl. Google lists this as its verification step, and also asks you to confirm downloads still start. - Check session continuity. With debug mode on, move across domains in DebugView and confirm
ga_session_idstays the same. - Check Realtime. One active session rather than two shows the handoff worked.
- Test the redirect path separately. One DebugView test found that links going through redirects do not get
_gladded automatically, which counts a new user. Fixing that needs a custom solution, so test every redirect, not just the plain links. - Confirm the campaign. In Realtime or the acquisition reports, check the session shows your
qrmedium and campaign name, not direct.
A dynamic QR code helps here. Because you can update the destination without changing the printed pattern, a fault found after launch can be fixed on the destination side. Our dynamic QR code generator is built around editable destinations.
Why cross-domain QR tracking fails
When numbers look wrong, work through the likely causes in order. A sound diagnostic sequence is to confirm the attribution scope, trace a conversion by transaction, client and session IDs, verify session_start, check that click IDs and UTMs survived redirects, and only then inspect channel rules, as this decision tree sets out. Its author warns against papering over broken collection with a custom channel rule.
| Symptom | Likely cause | What to do |
|---|---|---|
| QR visits all show as direct | Landing URL has no UTMs, or a redirect dropped them | Tag the final URL and forward the query string |
| Your own domain appears as a referral source | Domain change without cross-domain configuration, so each transition makes a new session and self-referral | Add the domain in the tag settings and tag both sites |
| Sessions restart at checkout | Third-party checkout overrides or strips the linker | Use a return page on your domain and referral exclusions |
_gl missing on some links |
Link built outside the tag’s control, such as server-rendered redirects, cached HTML or link shorteners | Link directly to the listed domain, or use the UTM transfer route |
| Session splits after a long pause | The linker’s short validity window expired | Keep the gap between click and page load short |
To detect self-referrals, filter the Traffic acquisition report by source equal to your own domain, or look for sessions that restart at checkout in Path exploration.
What this means for QR planning
The pattern across all these failures is the same: attribution is decided by the URL and the redirect chain, not by the dashboard. One practitioner puts it as QR tracking being a URL-engineering problem more than a tagging problem, where most of the work goes into what is baked into the printed code.
A short checklist for campaign managers before sending artwork to print:
- Name every domain the visitor may touch, and decide which are yours.
- Tag the final landing URL, not just the printed short link.
- Remove redundant redirects and test the rest for query-string loss.
- Add all owned domains to cross-domain measurement with one measurement ID.
- Test on a phone, from the actual printed code, in DebugView and Realtime.
If you want to go on to measuring what scans become, our guides on scan-to-conversion metrics and QR scan attribution pick up from here. For the bigger picture, see our practical guide to QR code tracking.
Our view: the code should outlive the setup
We build QRlytics on one idea: a printed QR code is a commitment, and the tracking behind it should be easy to correct without touching the print run.
That is why our dynamic codes let you update the destination URL after printing. If a redirect drops your UTMs, or a booking page moves to a new domain, you fix the link, not the poster. Codes created during an active subscription keep working permanently, even if billing changes, so the flyers, packaging and signage you already paid for stay useful.
Cross-domain work is a case where the details change over time: domains get acquired, event sites launch, booking tools are swapped. Real-time scan analytics, global heat maps and CSV export give you a scan-side record to set beside your GA4 reports, and our GDPR-compliant tracking keeps that record privacy-first.
Our advice is simple: tag the final URL, keep every hop honest, and use a code you can edit.
The
Try it on your next campaign
QRlytics gives you dynamic QR codes with editable destinations, real-time scan analytics, CSV export and API access for developers, so you can pair scan counts with the GA4 setup above. You can start on the free plan without a credit card, and paid annual plans unlock unlimited codes, advanced analytics and API access. See the Free and Pro plans or go straight to QR codes with analytics.

FAQ
Do I need cross-domain tracking if my QR code goes to a single website?
No. If the whole journey stays on one domain, GA4 keeps the session on its own. What you do need is a UTM-tagged landing URL, because an untagged scan is reported as direct traffic. Cross-domain measurement matters only when the visitor crosses to a separate registrable domain.
Does cross-domain tracking work with a third-party booking or checkout page?
Only if you can put your GA4 tag on it. If not, use referral exclusions and send the visitor back to a confirmation page on your own site where the conversion fires. A UTM-transfer script can keep campaign values, though GA4 still sees a new session on the second domain.
Why is the _gl parameter missing from my links?
It appears only when cross-domain measurement is configured and the destination domain is listed. It also goes missing when a link is created outside the tag’s control, such as through a server-side redirect or a link shortener, or when too much time passes between the click and the page load, according to this QA guide.
Can I change the QR code’s destination if I find a tracking mistake after printing?
With a dynamic QR code, yes. The printed pattern stays the same while you edit the URL it points to, so you can add UTMs or correct a domain without reprinting. A static code has the address fixed in the pattern itself.
Sources
- Configure your Google tag settings, Tag Manager Help
- Multi-Touchpoint Attribution: How to Capture Every Touch
- Cross Website Tracking: A Practical B2B Setup Guide
- Track QR Codes, TaggingDocs
- How to track QR codes in GA4 without fooling yourself
- Why UTM parameters get stripped, Missing Conversions
- Google Analytics Audit: Complete GA4 Guide, GA4 Experts
- Google Analytics for Online Ordering: A Setup Guide
- GA4 Data Collection and Privacy
- Google Analytics and Tag Manager Cheat Sheet
- Stripe Third-Party Checkout Tracking in GA4 via GTM
- Transfer UTM Parameters From One Page To Another with Google Tag Manager
- Google Analytics audit checklist: 10 checks for GA4
- How to Fix Direct Traffic in GA4: Step-by-Step Guide
- Google Analytics 4: Exploring Sessions with DebugView
- GA4 (direct), (not set) and Unassigned Diagnosis
- GA4 QA: Fixes for Common Problems, Webclat
- UTM Tracking for Google Business Profile