Install Prompt
Trigger modes (5 options)
| Mode | Behavior |
|---|---|
| Immediately | Show on page load |
| After delay | Show after N seconds |
| After scroll | Show after X% scroll depth |
| After page views | Show after N page views (localStorage counter) |
| Exit intent | Show when cursor leaves top of viewport |
Customization
- Banner text: customise headline + CTA button label
- Position: top / bottom banner, or centered modal
- Dismiss persistence: remember dismissal for X days
iOS Instructions
iOS Safari doesn't support the standard install prompt. oPWA detects iOS and shows a custom card with step-by-step "Share → Add to Home Screen" instructions. Automatically hidden if already installed (window.matchMedia('(display-mode: standalone)')).
Background Sync
Forms on the page are intercepted and their data stored in IndexedDB. On reconnect (after the user goes back online), stored form submissions are replayed automatically via the Background Sync API.
Configure in oPWA → Service Worker → Background Sync — enable/disable per form selector.
Analytics
Beacon-based analytics via POST /wp-json/opwa/v1/analytics/beacon:
| Metric | How tracked |
|---|---|
| Page views | Navigator beacon on each navigation |
| SW coverage | % of page loads served by SW (from SW postMessage) |
| Cache hit rate | Hit/miss reported per request |
| PWA installs | appinstalled event |
| Push opt-in rate | Subscribe / total visitors |
Analytics data stored in wp_opwa_analytics, visualized in oPWA → Analytics tab.
