QR codes that open your app (and fall back to the store)
How to make one QR code that opens your app on the right screen when it's installed, sends everyone else to Google Play or the App Store, and keeps the screen for after install. What to put in the code, how to print it, how to tag scans, and how to test.
A QR code on a menu, a parcel, a receipt or a shop poster should do one thing: put the person on the right screen of your app. A code that points at a website, or at one store, can't do that: Android users scanning an App Store code (or the reverse) hit a dead end.
The fix is not a special kind of QR code. A QR code is only a link. What happens after the scan depends entirely on which link it holds and on what answers that link. This post covers what to encode, what happens on each phone, how to print the code so it scans, and how to see which codes are working.
What to put in the QR code
| The code holds | App installed | No app, Android | No app, iPhone | Desktop |
|---|---|---|---|---|
| Your website | Website | Website | Website | Website |
| A Google Play link | Play listing | Play listing | Dead end | Play in a browser |
| An App Store link | App Store page (iPhone), dead end (Android) | Dead end | App Store | App Store in a browser |
| A deep link on your link domain | The screen | Play, then the screen | App Store page, then the screen (opt-in) | Website |
Only the last row serves everyone. It is an ordinary https:// link on a domain verified for your app, such as https://hilltop.strait.link/table-12, answered by a server that decides per phone.
There is a second reason to print a link you control: you can change where it points later. Packaging lasts for years; your store listing, your web pages and even your app can change in the meantime. With Strait you change a link's destination with one API call (PATCH /v1/links/{slug}) or in the dashboard, and every code already printed follows it (Short links).
What happens after the scan
The camera or scanner app opens the link. From there, it's the same as any other tap:
- Android, app installed. If the scanner hands the link to the system and your domain is verified, Android opens your app directly. If the link loads in a browser first, Strait answers with an
intent://hand-off that opens your app on the link's path. - Android, no app. The same hand-off falls back to Google Play, with the link and the scan attached in the install referrer. After install, the first open lands on the link's screen. This is the deferred deep link path, which we tested on a real phone with a Google Play internal testing build (deferred deep linking explained).
- iPhone. If the app is installed, Universal Links open it. If not, Safari shows a page with your app's name and a Get the app button for the App Store, and the first open after install can land on the screen. That install match is opt-in (off until you turn it on).
- Computer. Someone scanning a code on a screen with a laptop webcam, or opening the link on a desktop, goes to the link's desktop URL or its destination.
Scanner apps differ in whether they open links in the default browser, an in-app view or directly through the system. That's the main reason to test on the phones your customers carry rather than assume.
Printing a QR code that scans
The QR code standard has a few rules worth knowing before a print run. Denso Wave, the inventor of the QR code, documents them:
- Keep the quiet zone. "QR Code requires a four-module wide margin at all sides of a symbol" (Denso Wave: QR code size). Designers often crop it. Don't.
- Pick an error correction level. Level L restores about 7% of the code, M 15%, Q 25% and H 30%. M is the one most often chosen. Higher levels survive more damage but make the code denser (Denso Wave: Error correction).
- Short links make simpler codes. Fewer characters mean fewer modules, so the code scans from further away at the same printed size.
https://hilltop.strait.link/t12encodes into a smaller code than a full product URL with tracking tags. - Print vector. An SVG stays sharp at any size; a screenshot of a PNG doesn't.
If you generate codes yourself, the qrcode package for Node does all of this:
import QRCode from 'qrcode';
const url = 'https://hilltop.strait.link/table-12';
await QRCode.toFile('table-12.svg', url, {
type: 'svg',
errorCorrectionLevel: 'M',
margin: 4, // the four-module quiet zone
});Our free app QR code generator does the same in the browser: paste a link, download SVG or PNG, with the quiet zone and error correction set for print. In the Strait dashboard, every link also has a QR code download.
One code per placement, tagged
A code on table 12 and a code on the takeaway bag are different channels. If they share one link, you can't tell them apart. Two habits help:
- One link per placement. Create
/table-12,/bag-oct,/poster-mg-road. Each has its own taps and installs. - Tag the destination. Put
utm_source=qrandutm_medium=printon the destination, plusutm_campaignfor the offer andutm_contentfor the placement. Strait readsutm_sourceandutm_campaignfrom the destination, so scans show up next to WhatsApp and email in your reports, through the install on Android (REST API reference).
Creating a link is one request:
curl https://strait.link/v1/links \
-H "Authorization: Bearer $SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "slug": "table-12",
"longUrl": "https://shop.example.com/menu?utm_source=qr&utm_medium=print&utm_campaign=menu-oct&utm_content=table-12" }'For hundreds of placements, POST /v1/links/batch takes up to 500 links per call. The UTM builder keeps tag names consistent.
When a printed code outlives the offer
Printed codes stay in the world after the campaign ends. Rather than let the link die, decide what an old scan should do. With Strait, a link can expire at a set time, and you choose what happens next: an "expired" page, the app store for the phone, or a web page you pick. Expired scans are still recorded, never billed (When a link expires).
If you are replacing codes that pointed at Firebase Dynamic Links, Google stopped opening apps from those page.link links when the service shut down on 25 August 2025 (Firebase: Dynamic Links FAQ). Some now return 404; others still do a plain redirect to their old fallback, which Google could stop at any time. The page.link checker shows where each of yours pointed.
Testing before the print run
- App Links verified for the link domain (App Links checker)
- Scanned with the default camera on an Android phone and an iPhone
- Scanned with the app installed and with it uninstalled
- A printed proof scanned at the real size, in the light where it will hang
- Scan shows up in Analytics with channel
qrand the right campaign
Sources and how we checked
- Denso Wave, QR code size and margin and Error correction feature: the quiet zone and the L/M/Q/H levels.
- Firebase, Dynamic Links FAQ: the shutdown date.
- The per-device decisions, the Play referrer, the channel and campaign rules and the expiry options are from Strait's link engine code and its short links and API docs. The Android deferred path is from our real-phone test with a Google Play internal testing build (October 2026).
- The
qrcodeoptions are from the package's documentation on npm.