Dynamic QR Codes
Tracking tags
Without help, an order that started with a QR scan looks like a Direct visit — as if the customer had typed your address. Dynamic QR Codes fixes that in the free plugin: every scan carries standard UTM tags, so WooCommerce and Google Analytics see where the visit came from. For Google Tag Manager users it can also send a qr_scan event. Both live in QR Codes → Settings → Links & tracking and both are on by default.
UTM tags on every scan
When someone scans a code, the plugin sends them on — to the cart, the product page, the shop or a link code’s page — and adds the tags to that address. It applies to every scan, old codes included: codes printed with 1.x, retired codes, bundle codes, blank codes, and link codes pointing at another website. The switch is Add UTM tags when a scan opens your site or a link, on the Tracking tags card.
| Tag | Default value | Where it comes from |
|---|---|---|
utm_source | qr | The Source field on the Tracking tags card. |
utm_medium | print — or link | The Medium field. A code opened from its copied link (Copy link, shared in a message or email) uses link instead, so shared links and printed copies stay apart. |
utm_campaign | the campaign’s name, as a slug | Only for a code in a campaign Pro: “Summer sale” becomes summer-sale, unless the campaign’s own Campaign UTM field is filled in. No campaign, no tag. |
utm_content | the code’s label + address | Set once when the code is created, e.g. hoodie-with-logo-k7m2xa (its label, or the product name, then its six-character address). Renaming the code later doesn’t change it, so its reports never split. Codes made before 2.0 use their address alone. |
utm_term | — | Only when a campaign sets one Pro. |
So a scan of a printed hoodie code in your “Summer sale” campaign lands on something like:
https://yourstore.com/cart/?utm_source=qr&utm_medium=print&utm_campaign=summer-sale&utm_content=hoodie-with-logo-k7m2xa
Which value wins
A tag can be set in more than one place. For each tag, the most specific value wins:
- Typed into a link code’s destination — if the address you entered already has
?utm_source=newsletter, that stays. The destination’s own query string is never changed. - The code — its
utm_contentPro lets you change it under Advanced → Name in reports (UTM content) in the Edit dialog. - The campaign Pro — the UTM tags fields on a campaign (Source, Medium, Campaign, Term). A field left empty falls through to the next level.
- The site defaults — Source and Medium on the Tracking tags card.
Turning tags off
Switch Add UTM tags when a scan opens your site or a link off and scans carry no tags at all — not even the ones set on campaigns or codes. Your values are kept for when you switch it back on. Scans are still counted in the plugin either way; the tags are only for WooCommerce and your analytics tools.
What WooCommerce and Google Analytics show
- WooCommerce Order Attribution (WooCommerce 8.5 or newer, with order attribution on): the order’s Origin box reads Source: qr instead of “Direct”, and the source, medium and campaign show in the order’s attribution details.
- Google Analytics 4: the visit is reported under
qr / print(orqr / link) in your traffic acquisition reports, with the campaign and content — no setup needed beyond your usual GA4 tag.
A scan counts as the latest visit. WooCommerce and GA4 credit the last source they saw, so if someone clicked one of your ads earlier in the same session and then scanned a code, the order is credited to the QR scan. That’s usually what you want for print — just keep it in mind when comparing channels.
The plugin only adds the standard tags to the address; it never writes WooCommerce’s or Google’s data itself. For per-code scans, orders and revenue inside WordPress, see Track performance Pro.
The qr_scan event for Google Tag Manager
If you use Google Tag Manager, the plugin can tell it about each scan. With Send a qr_scan event to Google Tag Manager / GA4 on (the Google Tag Manager / GA4 card), the first page a scan opens on your store — the cart, a product page, the shop or a link code’s page on your site — pushes one event to the dataLayer:
window.dataLayer.push({
event: 'qr_scan',
qr_code: 'k7m2xa',
qr_label: 'Hoodie hangtag',
qr_campaign: 'summer-sale',
qr_kind: 'product',
qr_via: 'qr'
});
| Field | What it holds |
|---|---|
qr_code | The code’s six-character address, e.g. k7m2xa. |
qr_label | The code’s label. |
qr_campaign | The campaign’s name as a slug, or empty. Always the name — it ignores the campaign’s UTM Campaign field, so it can differ from utm_campaign. |
qr_kind | product, bundle, link, retired or unassigned (a blank code). |
qr_via | qr for a scan of the printed code, link for its copied link. |
- The plugin never loads Google Tag Manager or Google Analytics. It only adds the event to the
dataLayer; if there’s no tag manager on the page, nothing happens. - Consent is your site’s. Your tag setup and cookie banner decide whether anything is sent on. The event carries no personal data.
- Page caches don’t swallow it. To know which page comes after a scan, the plugin sets a short-lived cookie (10 minutes, no personal data). When a scan lands on a store page other than the cart or checkout, the plugin adds a one-off
qrcw_n=…parameter to the address, so page caches (WP Super Cache, WP Rocket, LiteSpeed, Cloudflare APO and the like) serve a fresh page and the event fires there. A small script removes the parameter from the address bar as the page opens; if it still shows up in your analytics, excludeqrcw_nas a query parameter. - No event for scans that lead to another website — a link code to your Instagram, say. The UTM tags still go with them.
- Bots and link previews never trigger it.
Send it to GA4 with Tag Manager
- Variables: create five Data Layer Variables named
qr_code,qr_label,qr_campaign,qr_kindandqr_via. - Trigger: a Custom Event trigger with the event name
qr_scan. - Tag: a Google Analytics: GA4 Event tag with your measurement ID, event name
qr_scan, and the five variables as event parameters. Fire it on the trigger above. - Preview, scan a code with your phone, check the event arrives in GA4’s DebugView, then publish. In GA4 you can register the parameters as custom dimensions and mark
qr_scanas a key event.
Don’t use Tag Manager? Leave the switch on or off — it makes no difference. The UTM tags alone are enough for GA4’s acquisition reports.
Next: Print your codes →
