Appearance
Track landing-page visits and leads
QR scans tell you who picked up the phone; the landing page tells you what happened next. One script tag on your page closes the loop, so Analys shows the full funnel: letters → scans → visits → leads.
1. Point the QR code at your page
Create the campaign with a QR code and trackingEnabled: true (see Track QR scans). Note the code's slug — it is the campaign key below.
2. Add the snippet
On the landing page (and any page you want counted), before </body>:
html
<script src="https://api.utskick.dr.se/api/t.js" data-campaign="summer-promo-a1b2"></script>That reports one visit per page load. When a recipient scans their letter, the redirect sends them to your URL with ?dr=<letter token> appended; the snippet reads it and remembers it for the session, so the visit is counted against that letter — never against a person.
?dr= on your URL
Your page keeps working exactly as before; the parameter is only read by the snippet. If your own analytics dislikes unknown parameters, strip it after the snippet has loaded.
3. Report leads
When a form is submitted (or whatever counts as a lead for you), call:
js
drse.lead();For example, on a form's submit handler, or on your thank-you page:
html
<script>
document.querySelector("form").addEventListener("submit", function () {
if (window.drse) drse.lead();
});
</script>What you see
Under Analys the campaign gets two more figures — Besök (visits, with unique visitors) and Leads (with unique leads) — and the funnel shows each step as a share of the letters sent. Both also appear in the daily chart.
What is stored
Per event: campaign, the letter's token (when the visit came through the redirect), a daily-rotating visitor hash, visit or lead, and the page's pathname (never the query string). No cookies, no IP address, no user agent. Bots are dropped. Events are deleted on the same 18-month clock as scans.
Next
- Analytics — what the tab shows
- Public endpoints — the exact contract