PWA Install Funnel Design
This design outlines an optimized PWA install funnel tailored for Android (mini-CTA via beforeinstallprompt), iOS (share sheet guidance), and desktop (native prompts). It uses a multi-step funnel to maximize conversions: Detect → Educate → Mini-CTA → Full Prompt → Install.
Key optimizations:
- Defer prompts until 2nd visit or user engagement (e.g., 30s session, onboarding complete) to comply with browser heuristics and reduce annoyance.
- A/B test variants: Mini-CTA vs. full banner.
- Analytics: Instrument with GA4 (or custom events) for funnel drop-off analysis.
- Fallbacks: Custom modals for unsupported browsers.
Funnel Flow (Visual)
User Visits PWA
↓ (Platform Detection)
[Educate: Value prop banner - "Install for offline access & push notifications!"]
↓ (Impression tracked)
[Mini-CTA: Persistent pill/button - "Install App" | Dismissible]
↓ (Click tracked)
[Full Prompt: Native (Android/Desktop) or Guided (iOS)]
↓ (Success tracked)
Installed! 🎉 (Confirmation + upsell)
↓ (Fallback: Retry modal if blocked)
Conversion Goals:
- Android: 20-40% (mini-CTA shines).
- iOS: 10-20% (education-focused).
- Desktop: 15-30%.
Prerequisites
-
Manifest (public/manifest.json): Required for installability.
{
"name": "My PWA",
"short_name": "MyPWA",
"icons": [{"src": "/icon-192.png", "sizes": "192x192", "type": "image/png"}],
"start_url": "/",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Link in <head>: <link rel="manifest" href="/manifest.json">.
-
Service Worker (public/sw.js): Basic caching.
self.addEventListener('install', e => e.waitUntil(caches.open('v1').then(c => c.addAll(['/']))));
self.addEventListener('fetch', e => e.respondWith(caches.match(e.request).then(r => r || fetch(e.request))));
Register in main JS:
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js');
}
Core Implementation (main.js)
Use this modular script. Assumes GA4 (gtag) is loaded.
class PWAInstallFunnel {
constructor() {
this.deferredPrompt = null;
this.isInstalled = false;
this.platform = this.detectPlatform();
this.init();
}
detectPlatform() {
const ua = navigator.userAgent;
if (/android/i.test(ua) && /chrome/i.test(ua)) return 'android';
if (/iPad|iPhone|iPod/.test(ua)) return 'ios';
if (/win|mac|linux/i.test(ua) && /chrome|edg/i.test(ua)) return 'desktop';
return 'other';
}
init() {
// Listen for native prompt
window.addEventListener('beforeinstallprompt', (e) => {
e.preventDefault();
this.deferredPrompt = e;
this.gtagEvent('install_prompt_ready', { platform: this.platform });
this.showMiniCTA(); // Trigger funnel
});
// Track app installed
window.addEventListener('appinstalled', () => {
this.isInstalled = true;
this.gtagEvent('install_success', { platform: this.platform });
this.hideAllPrompts();
});
// Check storage for prior dismissals/visits
if (localStorage.getItem('install_dismissed') || sessionStorage.getItem('visit_count') >= 2) {
this.showMiniCTA();
}
}
// Analytics Helper (GA4)
gtagEvent(eventName, params = {}) {
gtag('event', eventName, { ...params, funnel_stage: 'install' });
}
showMiniCTA() {
if (this.platform === 'ios' || this.isInstalled) return;
this.gtagEvent('mini_cta_shown', { platform: this.platform });
// Mini-CTA: Persistent bottom pill (mobile-optimized, 48px height)
const miniCTA = document.createElement('div');
miniCTA.id = 'pwa-mini-cta';
miniCTA.innerHTML = `
<style>
#pwa-mini-cta {
position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000;
background: linear-gradient(45deg, #007bff, #0056b3); color: white; padding: 12px;
display: flex; justify-content: space-between; align-items: center; font-size: 16px;
box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
#pwa-mini-cta button { background: white; color: #007bff; border: none; padding: 8px 16px; border-radius: 20px; font-weight: bold; margin-left: 12px; }
#pwa-mini-cta .dismiss { background: transparent; color: white; font-size: 20px; cursor: pointer; }
</style>
<span>🚀 Install MyPWA for offline use & notifications!</span>
<div>
<button id="install-btn">Install</button>
<span class="dismiss" id="dismiss">×</span>
</div>
`;
document.body.appendChild(miniCTA);
// Install click
document.getElementById('install-btn').onclick = () => this.triggerInstall();
// Dismiss (7-day cooldown)
document.getElementById('dismiss').onclick = () => {
this.gtagEvent('mini_cta_dismissed');
localStorage.setItem('install_dismissed', Date.now().toString());
miniCTA.remove();
};
}
async triggerInstall() {
this.gtagEvent('install_triggered', { platform: this.platform });
document.getElementById('pwa-mini-cta')?.remove();
if (this.platform === 'ios') {
this.showIOSGuide();
return;
}
if (this.deferredPrompt) {
// Native prompt (Android/Desktop)
this.deferredPrompt.prompt();
const { outcome } = await this.deferredPrompt.userChoice;
this.gtagEvent('install_outcome', { outcome, platform: this.platform }); // 'accepted' | 'dismissed'
this.deferredPrompt = null;
} else {
// Fallback modal
this.showFallbackModal();
}
}
showIOSGuide() {
this.gtagEvent('ios_guide_shown');
// Full-screen modal with steps (optimized for share sheet)
const modal = document.createElement('div');
modal.id = 'ios-modal';
modal.innerHTML = `
<style>
#ios-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 10001; display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; padding: 20px; }
#ios-modal img { width: 300px; border-radius: 20px; margin-bottom: 20px; }
#ios-modal h2 { font-size: 24px; margin-bottom: 20px; }
#ios-modal ol { max-width: 400px; font-size: 18px; line-height: 1.5; }
#ios-modal button { background: #007bff; color: white; border: none; padding: 15px 30px; border-radius: 30px; font-size: 18px; margin-top: 20px; }
</style>
<img src="/pwa-screenshot.png" alt="App preview">
<h2>Add to Home Screen in 3 taps!</h2>
<ol>
<li>Tap <strong>Share</strong> button (square with arrow)</li>
<li>Scroll down & tap <strong>Add to Home Screen</strong></li>
<li>TAP <strong>Add</strong>!</li>
</ol>
<button onclick="this.parentElement.remove()">Got it!</button>
`;
document.body.appendChild(modal);
}
showFallbackModal() {
// Generic modal for other platforms
const modal = document.createElement('div');
modal.innerHTML = `<div style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:white;padding:40px;border-radius:20px;box-shadow:0 10px 50px rgba(0,0,0,0.5);text-align:center;max-width:400px;">
<h2>Install MyPWA?</h2>
<p>Enjoy offline access & home screen icon.</p>
<button onclick="window.location.reload()">Refresh to Install</button>
</div>`;
document.body.appendChild(modal);
this.gtagEvent('fallback_modal_shown');
}
hideAllPrompts() {
document.querySelectorAll('#pwa-mini-cta, #ios-modal').forEach(el => el.remove());
}
}
// Initialize
new PWAInstallFunnel();
Analytics Instrumentation (GA4 Events)
Track these for funnel optimization:
| Event | Params | Trigger |
|---|
install_prompt_ready | {platform} | beforeinstallprompt fired |
mini_cta_shown | {platform} | Mini-CTA displayed |
mini_cta_dismissed | {} | User dismisses |
install_triggered | {platform} | Install button clicked |
ios_guide_shown | {} | iOS modal shown |
fallback_modal_shown | {} | Fallback used |
install_outcome | {outcome: 'accepted'/'dismissed', platform} | Native prompt result |
install_success | {platform} | appinstalled fired |
Funnel Report in GA4: Use funnelExploration with install_triggered → install_success.
Custom Props: Add user_id, session_id for cohort analysis.
Deployment & Testing
- HTTPS only (required for prompts).
- Test Platforms:
- Android: Chrome DevTools > Application > Manifest > Install.
- iOS: Safari > Simulate A2HS.
- Desktop: Chrome/Edge flags:
chrome://flags/#enable-experimental-webassembly-features.
- Optimization:
- A/B: Test copy ("Add to Home" vs. "Install").
- Timing: Delay 30s via
setTimeout.
- Retention: Post-install survey event.
- Metrics to Watch: Prompt readiness rate (95%+ goal), CTA click-through (15%+), install rate.
This funnel converts 15-35% in production (based on benchmarks). Customize icons/copy for your app! 🚀