Use Case: QR Code Deep Linking

QR Code Deep Linking

Create QR codes that link directly to your app. Use deferred deep linking to handle uninstalled apps, preserve context, and track campaigns from restaurants, retail, and events.

The Problem

The QR code to app problem

QR codes are everywhere: restaurant menus, event tickets, retail displays, and marketing materials. But when users scan a QR code on mobile and don't have your app installed, the experience breaks down.

What happens without deep links:

  1. 1.User at restaurant/event scans QR code on their phone.
  2. 2.Browser opens, showing a landing page instead of app content.
  3. 3.User is prompted to install app from app store. Context is lost.
  4. 4.After install, user returns to app home screen. What were they looking for? They don't remember.
  5. 5.User abandons. You lose a customer interaction and can't track the campaign.

Without deferred deep links

  • QR code context lost when app installs
  • Users see generic home screen, not intended content
  • No campaign attribution or tracking
  • High drop-off rate after app install

With deferred deep links

  • QR code context preserved through app install
  • App opens directly to intended content (menu, ticket, offer)
  • Full campaign tracking and attribution
  • Higher engagement and conversion rates
How It Works

How deferred deep links enable QR code experiences

Deferred deep links preserve your QR code target and context even when the app isn't installed at scan time.

Step 1: Create a QR code with a Redirectly deep link

Generate a Redirectly deep link with your content parameters: https://myapp.redirectly.app/menu?restaurant=downtown&campaign=lunch. Encode this URL into a QR code.

Step 2: User scans QR code on mobile

If the app is already installed, the deep link opens directly to your menu with parameters intact.

If the app is not installed, Redirectly captures the full URL and stores it.

Step 3: Redirectly directs to app store

User is sent to App Store or Play Store to install your app. The full deep link URL (including context) is preserved in Redirectly's servers.

Step 4: SDK retrieves the deferred link

When your app launches for the first time after install, the Redirectly SDK queries the servers: "What deep link should this user see?" Redirectly responds with the full QR code URL including all parameters.

Step 5: App navigates to content

Your app receives the deep link with context (restaurant ID, campaign name, etc.) and navigates directly to the intended content. User sees exactly what they scanned.

Real-World Use Cases

QR codes in restaurants, retail, and events

Restaurants: Digital Menus

A restaurant places QR codes on tables. Customer scans with phone. If they have the app, they see the menu for that specific location. If not, they install the app and immediately see the location-specific menu with real-time updates. Campaign tracking reveals which locations drive the most app installs.

Retail: In-Store Promotions

A clothing retailer prints QR codes on product displays, receipts, or window posters. Customers scan to view product details, reviews, or exclusive in-app offers. Deferred deep linking ensures users who install the app see the exact product they scanned, increasing conversion. UTM parameters track which promotions drive the most app engagement.

Events: Ticketing & Engagement

Event organizers include QR codes on tickets or posters linking to event details, seating maps, or exclusive content. Attendees who don't have the app scan, install, and automatically land on the event page. Track which marketing channels drive the most ticket sales through QR code attribution.

Marketing: Campaign Attribution

Print unique QR codes on different marketing materials (posters, flyers, ads) using Redirectly's link generator. Track which campaigns drive the most app installs and engagement. Preserve campaign context through install with UTM parameters in deep links.

Code Example

Simple SDK usage

Backend: Generate QR code deep links

Create Redirectly deep links for your QR codes with context parameters:

# Example backend code (Python) import requests import qrcode # Generate a Redirectly deep link for a restaurant menu restaurant_id = 'downtown_location' campaign = 'lunch_promotion' deep_link = ( f"https://myapp.redirectly.app/menu" f"?restaurant={restaurant_id}" f"&campaign={campaign}" ) # Create QR code qr = qrcode.QRCode(version=1, box_size=10) qr.add_data(deep_link) qr.make(fit=True) qr_image = qr.make_image() qr_image.save(f"qr_code_{restaurant_id}.png")

Mobile: Setup and handle QR code deep links

Initialize Redirectly and listen for deep links from QR code scans:

import 'package:redirectly/redirectly.dart'; import 'package:go_router/go_router.dart'; void main() async { // Initialize Redirectly await Redirectly.initialize( apiKey: 'your_api_key_here', ); // Listen for QR code deep links (including deferred) Redirectly.onDeepLink.listen((link) { print('QR code scanned: ${link.fullUrl}'); print('Path: ${link.path}'); print('Parameters: ${link.queryParameters}'); }); runApp(const MyApp()); }

Navigation: Handle menu deep links

Parse QR code parameters and navigate to content:

// In your routing setup Redirectly.onDeepLink.listen((link) { // Parse the QR code parameters if (link.path == 'menu') { final restaurantId = link.queryParameters['restaurant']; final campaign = link.queryParameters['campaign']; // Navigate to restaurant menu with context context.go('/menu?restaurant=$restaurantId&campaign=$campaign'); // Track the campaign analytics.logEvent( 'qr_scan', parameters: { 'restaurant': restaurantId, 'campaign': campaign, }, ); } }); // Route definition GoRoute( path: '/menu', builder: (context, state) { final restaurantId = state.queryParameters['restaurant'] ?? ''; final campaign = state.queryParameters['campaign'] ?? ''; return RestaurantMenuScreen( restaurantId: restaurantId, campaign: campaign, ); }, )

This implementation ensures that:

  • QR codes encode Redirectly deep links with context (restaurant, campaign, product)
  • Deferred deep linking preserves context even if app isn't installed at scan time
  • App navigates directly to content after install without losing context
  • Campaign tracking is built-in via UTM parameters in the URL
FAQ

Frequently asked questions

Can I use the same QR code for both app and web?

Yes. Redirectly deep links work seamlessly on both mobile and web. On mobile, the app opens directly. On desktop, the deep link opens your website. This makes QR codes universally useful.

How do I track which QR codes drive the most installs?

Use UTM parameters in your Redirectly deep links (e.g., ?utm_campaign=restaurant_launch). Each QR code can have unique campaign identifiers. Redirectly preserves these through the install, so you can attribute conversions to specific campaigns.

What happens if someone scans the QR code on desktop?

Redirectly detects the platform. On desktop, it opens your mobile website or web app. On mobile without the app installed, it starts the install flow. No friction either way.

Can I update the deep link destination without reprinting QR codes?

Yes. Use a Redirectly short link in the QR code. Then you can update the destination URL in your dashboard anytime without changing the QR code.

Do QR codes work with React Native?

Yes. Redirectly works with Flutter, React Native, and native iOS/Android. The QR code handling is identical across all platforms.

What data can I pass through a QR code deep link?

You can pass any data as query parameters: product IDs, location IDs, promo codes, event IDs, campaign names, etc. Keep URLs under 2048 characters for maximum QR code reliability.

Try Redirectly Free

Get a free API key, subdomain, and 10k monthly links.