Google Analytics + WiFi: Offline-to-Online Attribution
Key Takeaways: Connecting WiFi captive portal data to Google Analytics 4 (GA4) enables offline-to-online attribution — tying physical store visits to digital ad campaigns. The GA4 Measurement Protocol accepts custom events from WiFi platforms, creating a unified view of online and offline customer behavior. Google reports 12.3 million active GA4 properties worldwide (Google Analytics Platform Status, 2025). WiFi attribution data answers the question every marketer dreads: "Did that Google Ad actually drive anyone to the store?"
Google Analytics tracks everything that happens on a website. Page views, conversions, traffic sources, user flows. What it can't track — at least not natively — is what happens in the physical world.
A customer sees a Google ad. Clicks to the website. Browses for 3 minutes. Leaves. Two days later, walks into the store and buys.
In GA4, that customer is a "bounced session." In reality, they converted. The ad worked. But the attribution model has no idea, because the store visit is invisible.
WiFi data makes it visible.
When that customer connects to the store's WiFi, the captive portal captures their email. If that email matches the one associated with their Google account (or a Google Ads customer list), you've closed the loop. Online ad → website visit → physical store visit. Full attribution.
The Attribution Gap
According to Google's own research (Think with Google, 2024), 76% of people who search for something nearby on their smartphone visit a related business within 24 hours. But only 28% of those visits result in a purchase that can be attributed back to the digital touchpoint.
That 48-point gap is what offline attribution solves. And WiFi data is one of the most practical ways to fill it — no beacon hardware, no app downloads, no NFC tapping. Just WiFi, which every venue already has.
Integration Architecture
Two methods to get WiFi data into GA4:
Method 1: GA4 Tag on the Captive Portal
Embed the GA4 tracking tag (gtag.js) on the WiFi splash page. This tracks portal interactions as GA4 events.
Events captured:
| Event | Trigger | Parameters |
|---|---|---|
page_view | Portal loads | page_location, page_title |
wifi_portal_start | Portal form displayed | location_name, login_method |
wifi_portal_complete | Guest submits form | location_name, login_method, capture_type |
wifi_social_login | Guest uses social login | provider (Facebook, Google) |
Setup:
- •Get the GA4 Measurement ID (format: G-XXXXXXXXXX) from the client's GA4 property
- •In MyWiFi's portal editor, add the gtag.js snippet to the portal's custom HTML section
- •Configure custom events using gtag() calls tied to portal interactions
Limitation: The captive portal browser (iOS CNA) may block gtag.js in some configurations. Test on actual iOS devices. Android works reliably.
Method 2: GA4 Measurement Protocol (Recommended)
Send WiFi events directly to GA4's server-side Measurement Protocol. No browser dependency. Works regardless of device/browser limitations.
How it works:
- •WiFi guest completes portal → MyWiFi fires a webhook
- •Webhook hits a middleware (via Zapier, AWS Lambda, or custom server)
- •Middleware sends a POST request to GA4 Measurement Protocol endpoint
Measurement Protocol endpoint:
POST https://www.google-analytics.com/mp/collect?measurement_id=G-XXXXXXX&api_secret=YOUR_SECRET
Payload:
{
"client_id": "wifi_guest_12345",
"user_id": "hashed_email",
"events": [{
"name": "wifi_visit",
"params": {
"location_name": "Downtown Store",
"visit_number": 3,
"dwell_time_minutes": 42,
"login_method": "email",
"device_category": "mobile"
}
}]
}
Key fields:
- •
client_id: A unique identifier for the guest (use a hash of their email or MyWiFi guest ID) - •
user_id: The guest's email hash — enables cross-device matching in GA4 - •
events[].name: Custom event name (wifi_visit, wifi_new_guest, wifi_disconnect) - •
events[].params: Event parameters for segmentation and reporting
Getting the API Secret
- •In GA4, go to Admin > Data Streams > [Your Stream] > Measurement Protocol API secrets
- •Create a new secret
- •Use this secret in your Measurement Protocol requests
Custom Events to Send
Design your event taxonomy before implementation:
| Event Name | When It Fires | Key Parameters |
|---|---|---|
wifi_new_guest | First-time portal completion | location, login_method, source_campaign |
wifi_return_visit | Returning guest connects | location, visit_count, days_since_last |
wifi_disconnect | Guest session ends | location, dwell_time, session_type |
wifi_vip_visit | Guest with 10+ visits connects | location, visit_count, vip_tier |
wifi_cross_location | Guest visits a different location | new_location, previous_location |
These events appear in GA4's Events report alongside standard web events. You can build audiences, create conversions, and analyze funnels using WiFi data just like website data.
Building Audiences in GA4
Audience: WiFi Store Visitors (All)
Definition: Users who triggered wifi_new_guest OR wifi_return_visit in the last 30 days.
Use: Export to Google Ads for retargeting. Show search and display ads to people who physically visited the store.
Audience: High-Value WiFi Visitors
Definition: Users who triggered wifi_return_visit with visit_count >= 5 in the last 90 days.
Use: Lookalike expansion in Google Ads. Find new customers who resemble your client's best existing customers.
Audience: Lapsed WiFi Visitors
Definition: Users who triggered wifi_disconnect more than 30 days ago with no subsequent wifi_return_visit.
Use: Win-back campaigns on Google Ads. "We miss you — here's 20% off."
Audience: Cross-Location Visitors
Definition: Users who triggered wifi_cross_location event.
Use: Premium segment for brand loyalty campaigns. These customers actively choose the brand across multiple locations.
Offline-to-Online Attribution Model
Here's where it gets powerful. The complete attribution flow:
1. Customer clicks Google Ad → lands on website (GA4 tracks session)
2. Customer leaves website (GA4 records source: google/cpc)
3. Customer visits store → connects to WiFi (Measurement Protocol sends wifi_visit event)
4. GA4 matches user_id across sessions (email hash)
5. Attribution: Store visit attributed to Google Ads campaign
For this to work, you need user_id matching. The flow:
- •On the website: Set
user_idwhen the visitor submits a form or logs in (hash of their email) - •On the WiFi portal: Send the same
user_id(hash of the same email) via Measurement Protocol
GA4's cross-device matching connects the web session to the WiFi visit. The original traffic source (Google Ads, organic search, social, email) is preserved.
Match rate reality check: This only works when the website visitor AND WiFi guest use the same email. For many businesses, the overlap is 15–30% (people who've submitted a form on the website AND connected to in-store WiFi). That's a meaningful sample for attribution analysis, even if it doesn't cover 100% of customers.
Google Ads Integration
Customer Match
Export WiFi guest emails from MyWiFi → upload to Google Ads as a Customer Match audience. Google matches emails to Google accounts and targets them with search, display, YouTube, and Gmail ads.
Match rate: 40–55% for email-only uploads. Higher with phone numbers included. Google requires a minimum of 1,000 matched users for Customer Match audiences.
Store Visit Conversions
Google Ads offers "Store Visit Conversions" as a metric for eligible advertisers. This uses location history from Google users to estimate store visits after ad interaction. WiFi data can supplement this:
- •WiFi visit data confirms actual visits (higher accuracy than Google's estimation)
- •WiFi captures identity (Google's store visits are anonymous and aggregated)
- •WiFi works for all venues (Google's store visit tracking requires significant ad spend and location setup)
Use WiFi attribution data to validate or challenge Google's store visit estimates. If Google says your client's campaign drove 50 store visits, but WiFi data shows 80 attributable visits, you know Google's model is underestimating.
Reporting: The Attribution Report
Build a monthly attribution report combining GA4 and WiFi data:
Section 1: Online Activity
- •Website sessions by source
- •Conversion rate by source
- •Cost per conversion (from Google Ads)
Section 2: Offline Activity (WiFi)
- •Total WiFi captures
- •New vs. returning ratio
- •Average dwell time
- •Peak visit hours
Section 3: Attribution Bridge
- •Matched users (appeared online AND offline): count and %
- •Store visits attributed to Google Ads
- •Store visits attributed to organic search
- •Store visits attributed to email campaigns
- •Store visits attributed to social media
Section 4: ROI
- •Online conversion value (e-commerce, form fills)
- •Offline conversion value (attributed store visits × average order value)
- •Blended ROAS (total value / total ad spend)
This report shows the client their actual marketing ROI — not just the online slice that GA4 captures natively. The blended ROAS number is almost always higher than the online-only ROAS, which justifies continued (or increased) ad spend.
Technical Considerations
Data Freshness
Measurement Protocol events appear in GA4's Realtime report within seconds. They appear in standard reports within 24–48 hours (GA4's processing lag). For same-day reporting, use GA4's Realtime or BigQuery export.
Client ID Management
Every GA4 user needs a client_id. For WiFi events sent via Measurement Protocol, generate a consistent client_id per guest:
client_id = hash(guest_email + "wifi_salt")
Use the same hashing function consistently. If the same person visits multiple locations, the same client_id ensures GA4 recognizes them as one user.
GA4 Property Configuration
Create custom dimensions in GA4 for WiFi-specific parameters:
| Custom Dimension | Scope | Parameter Name |
|---|---|---|
| WiFi Location | Event | location_name |
| Visit Number | Event | visit_count |
| Dwell Time | Event | dwell_time_minutes |
| Login Method | Event | login_method |
| Device Category | Event | device_category |
Register these as custom dimensions in GA4: Admin > Custom definitions > Create custom dimension. Without this step, the parameters are collected but not available in standard reports.
Consent Mode
GA4's Consent Mode affects how data is collected and processed. For WiFi events sent server-side via Measurement Protocol, Consent Mode doesn't apply directly — it's a browser-side feature. However, ensure that the WiFi portal collects proper consent before sending data to GA4, particularly for GDPR compliance.
FAQ
Do I need Google Analytics 360 for this?
No. Standard GA4 (free) supports Measurement Protocol, custom events, custom dimensions, and audience building. GA360 adds BigQuery streaming export and higher data limits, but isn't required for WiFi attribution.
How accurate is the offline-to-online attribution?
It depends on the user_id match rate. If 25% of your WiFi guests also visited the website with the same email, you have a 25% match rate. The attribution for that 25% is accurate (deterministic matching). For the remaining 75%, you can use probabilistic methods or simply note that attribution covers a sample, not the full population.
Can this work with Google Tag Manager?
Yes. Deploy the GA4 tag via GTM on the captive portal for the browser-side approach. For the Measurement Protocol approach, GTM isn't involved — the events go server-to-server.
What's the minimum data volume for useful attribution?
Aim for at least 1,000 WiFi captures per month and 5,000 website sessions per month. Below these thresholds, the overlap (matched users) is too small for statistically meaningful attribution. Larger venues with 10,000+ monthly WiFi captures produce robust attribution data.
How do I handle venues where the WiFi portal is on a different domain than the website?
This is expected. The portal and website are typically on different domains. Cross-domain attribution works through user_id matching (email hash), not cookie-based sessions. The Measurement Protocol approach handles this natively — no cross-domain tracking configuration needed.
Can I use this data in Looker Studio (Data Studio) dashboards?
Yes. GA4 data (including custom WiFi events) flows into Looker Studio via the native GA4 connector. Build custom dashboards that combine online web metrics with offline WiFi metrics in a single view.