-
Notifications
You must be signed in to change notification settings - Fork 0
Scanning and Tracking
The plugin records every visit made through a QR code URL and categorizes each scan by its source.
The plugin recognizes these incoming URL patterns and handles them differently:
| URL Format | Example | Tracked As |
|---|---|---|
| Query string scan | /?qr=abc123 |
query |
| Path-based share | /abc123 |
social_link |
| Legacy format | /?postcode=XX1&city=London&tree=Tree1 |
legacy — redirects to ?qr= format |
| Social with source | /abc123?qr_source=social |
social_link |
For every scan, the plugin logs:
| Field | Description |
|---|---|
| Tracker ID | Which QR code was scanned |
| Scanned At | UTC timestamp |
| Scan Source |
query, social_link, legacy, postcode-city-tree, or url_match
|
| Visitor Hash | SHA-256 hash of the visitor's IP address + user agent (not personally identifiable) |
| Request URI | The full URL path and query string |
The plugin uses a visitor hash (SHA-256 of IP + user agent) to detect repeat visitors. This means:
- The same person scanning multiple times appears as multiple scan log entries.
- Reports can distinguish unique vs. repeat visitors.
- No personally identifiable data (IP addresses, names) is stored in the logs.
Each QR record stores two running counters:
-
Scan Count — incremented on every
?qr=query string hit -
Social Share Count — incremented on every path-based (
/shortcode) hit
These are visible in the QR Tracker list view and individual QR reports.
When a QR code is shared socially (e.g. on Facebook or Instagram), the shared URL is the path-based short link: https://yoursite.com/abc123.
When someone clicks that shared link:
- The plugin detects it is a path-based request (not a
?qr=scan). - It loads the destination page content in-place — the browser URL stays as
/abc123rather than redirecting. - The visit is logged as a
social_linkscan source. - The social share count for that QR code is incremented.
This design makes the short link look clean when shared on social media.
Older QR codes may use the format /?postcode=XX1&city=London&tree=Tree1. When the plugin detects this format:
- It looks up the QR record by postcode/city/tree.
- Redirects to the canonical
?qr=SHORTCODEformat. - Logs the scan as
legacysource.
If you need to troubleshoot scan tracking, enable Visit Tracking Debug Mode in QR Tracker → Settings → General. This displays an on-page panel on scan pages showing:
- Whether a QR record was matched
- Scan source detected
- Timing information
Disable debug mode in production.
All scan records are stored in the wp_qr_tracker_logs database table. Logs are not automatically pruned — they accumulate over time. Use the Reports & Analytics page and CSV export to archive and review old data.