Skip to content

MOP 3.4 — Public Wi-Fi Captive Portal: Ads & Analytics

Audience: super_admin, society_admin Outcome: Guests / residents who connect to the society Wi-Fi land on a branded captive portal that runs ads (MOP 3.2), captures opt-in identity (phone OTP) and reports impressions / clicks back to the dashboard.

1. Architecture

[Wi-Fi Controller] ── Walled-garden ─▶ Captive portal (HTML)
                                       │   served by FastAPI
                                       │   /api/wifi-portal/{society_id}
                                       Ads from /api/ads/active?surface=wifi_portal
                                       Identity: phone + OTP → /api/wifi-portal/auth
                              wifi_sessions  +  ad_interactions

2. Ad placement

Use MOP 3.2 to create an ad with: - type = wifi_portal - slot_template = WIFI_HERO (1920×1080) or WIFI_FOOTER (1280×200) - targeting society_id (and optionally child_society_id) - frequency cap: usually 1 impression per session, refresh per re-connect

3. Analytics surfaced in Admin Dashboard

Revenue → Wi-Fi Portal: - Sessions per day / per phase - Unique users (de-dup by phone hash) - Top advertisers + CTR - Average session duration

4. APIs touched

Method Endpoint
GET /api/wifi-portal/{society_id} (HTML)
POST /api/wifi-portal/auth?phone=...
POST /api/wifi-portal/verify-otp
POST /api/ads/{ad_id}/interaction
GET /api/admin/wifi-analytics?society_id=&from=&to=

5. Edge cases & FAQ

  • Free / no-OTP portal → set auth_required = false on the wifi_portal config; sessions are still tracked but anonymously.
  • GDPR / DPDP — phone numbers are stored hashed (SHA-256) in wifi_sessions.phone_hash for analytics.
  • Multiple Wi-Fi networks in a society → set the controller to send the matching society_id in the redirect URL.
  • MOP 3.2 — Digital Signage & Ad Creation
  • MOP 1.3 — Phase Isolation (analytics scoped automatically)