Cross-Platform Web + App Analytics Best Practices
Unify web and mobile data with one GA4 property, stitch identity across platforms, and analyze the full cross-device journey in BigQuery.
By Samarth Analytics · Published · Updated · Conversion Tracking · 10 min read
Summary: A field-tested playbook for unifying web, iOS, and Android analytics under a single GA4 property. Covers Firebase-to-GA4 data model alignment, user_id stitching, deeplink attribution, consent propagation from web CMP to mobile SDK, and BigQuery analysis for cross-platform user journeys.
- Consolidate web and mobile data into a single GA4 property using distinct data streams to ensure a unified view of the customer journey.
- Implement a consistent
user_idacross all platforms to stitch sessions together, moving beyond anonymous device IDs to person-centric reporting. - Use universal links and app links to maintain attribution data when users transition from a mobile browser into your native application.
- Align event naming conventions between the web and Firebase SDKs to prevent data fragmentation and simplify cross-platform reporting.
- Leverage a unified BigQuery export to perform deep-dive analysis on raw data without the need for complex manual table merging.
The modern customer journey is anything but a straight line. A user might discover your brand through a mobile search, browse your catalog on a desktop during their lunch break, and finally make a purchase inside your native iOS or Android app. Historically, tracking this behavior meant managing two entirely different analytics stacks - one for the web and another for mobile. This created silos where "Users" on the web were counted as entirely different entities than "Users" on the app, leading to inflated metrics and a fractured understanding of marketing ROI.
Implementing cross-platform web and app analytics is no longer a luxury for enterprise players - it is the minimum requirement for any business that operates across multiple digital touchpoints. By aligning your data architecture under a unified model, you move from measuring sessions to measuring people. This guide outlines the technical and strategic best practices for achieving a "single source of truth" in a fragmented device landscape.
Why a single GA4 property for web + app beats two separate properties
When Google Analytics 4 (GA4) was released, it represented a fundamental shift in how data is collected and processed. Unlike Universal Analytics, which was built on a session-based model designed for the web, GA4 is built on an event-based model inherited from Firebase. This makes GA4 natively cross-platform.
Choosing a single GA4 property for your web and app data is the first and most critical decision you will make. When you use separate properties, you are effectively telling Google that your web traffic and app traffic have nothing to do with each other. By using a single property with multiple "Data Streams" (one for Web, one for iOS, and one for Android), you allow the GA4 processing engine to automatically deduplicate users who visit you on multiple platforms.
This unification allows for powerful cross-platform reporting. You can easily answer questions like: "How many users who visited the website later installed the app?" or "What is the total lifetime value of a user across all platforms?" If these data points live in separate properties, answering these questions requires manual data extraction and complex SQL joins. Furthermore, a unified property allows Google's machine learning models to better predict user behavior and churn, as they have access to the full breadth of the user's interactions with your brand.
Firebase to GA4: the data model unification
The technical backbone of cross-platform tracking is the Firebase Analytics SDK. For mobile developers, Firebase is the standard; for web analysts, GA4 is the interface. The beauty of this setup is that they are two sides of the same coin. When you link a Firebase project to a GA4 property, your app events flow into GA4 in real-time.
However, unification requires planning. Firebase and the web-based gtag.js have different "automatically collected" events. For example, Firebase automatically tracks app_clear_data and os_update, while the web stream automatically tracks page_view and scroll. To achieve a unified data model, you must ensure that your "Recommended" and "Custom" events use the exact same naming conventions across both platforms.
If your web developers call an event sign_up but your mobile developers call it user_registration, GA4 will treat them as two different actions. This breaks your conversion funnels and makes it impossible to see a consolidated "Sign Up" count. Best practice is to create a shared tracking plan - usually a spreadsheet or a data dictionary - that dictates the exact naming of events and parameters (e.g., item_id, transaction_id) to be used by all engineering teams.
Stitching identity: user_id across web, iOS, Android
The "holy grail" of cross-platform web and app analytics is identity stitching. By default, analytics platforms use device-specific IDs (like the client_id in a browser cookie or the IDFV on iOS). These IDs only tell you about a device, not a person. To see a single user across their laptop, tablet, and phone, you must implement the user_id feature.
The user_id should be a non-personally identifiable string (like a database UID) from your authentication system. Once a user logs in, you pass this ID to GA4 or Firebase. Google then uses this ID to "stitch" the user's history together. If they browsed anonymously on the web yesterday and log into the app today, GA4 can retrospectively associate those web sessions with the now-identified user.
To implement this correctly, the code must be consistent. Below is an example of how you would set the user_id on the web versus the mobile app:
// WEB: Using gtag.js to set the User ID after a user logs in
gtag('config', 'G-XXXXXXXXXX', {
'user_id': 'unique_db_user_78945'
});
// MOBILE (iOS/Swift): Using the Firebase SDK to set the same ID
import FirebaseAnalytics
Analytics.setUserID("unique_db_user_78945")
// MOBILE (Android/Kotlin): Same logic, same ID value
FirebaseAnalytics.getInstance(context).setUserId("unique_db_user_78945")
By ensuring that unique_db_user_78945 is the exact same value across all three snippets, you bridge the gap between platforms. This allows the "Blended" reporting identity in GA4 to prioritize the User ID over device IDs, giving you the most accurate user count possible.
Deeplink attribution when users jump from web to app
One of the most common points of "attribution leakage" occurs when a user is on your mobile website and clicks a button to "Open in App." Without proper configuration, the transition from the browser to the native app context often breaks the referral chain. The app session starts as "Direct," and you lose the knowledge that the user originally came from a paid search ad or a social media post.
To solve this, you must implement Universal Links (iOS) and App Links (Android). These are not just standard deeplinks; they are verified associations between your website domain and your app. When a user clicks a link to your site, the OS checks if the app is installed and opens it directly.
Crucially, you must ensure that your attribution parameters (UTMs) are passed through the link and captured by the app's initial "open" event. Tools like Firebase Dynamic Links (now transitioning to simpler App Links or third-party solutions like Branch) help maintain this continuity. When the app opens, the SDK should parse the URL, extract the utm_source, utm_medium, and gclid, and manually log an app_open or campaign_details event to ensure the credit goes to the correct marketing channel.
Handling session continuity across device switches
A "session" is a logical grouping of user interactions within a given timeframe. In a cross-platform world, sessions are tricky. If a user adds an item to their cart on the web and then opens the app 10 minutes later to finish the purchase, is that one session or two?
Technically, GA4 will treat these as two separate sessions because the session_id is generated locally on each stream. However, if you have implemented user_id stitching, GA4 can associate both sessions with the same user. To improve session continuity, you should focus on synchronizing state.
For example, if a user starts a checkout process on the web, you can pass a custom parameter in a deeplink or via your backend to the app. When the app opens, it can "resume" the session context. While GA4 may still show two session IDs in the raw data, your ability to report on "User Conversion Rate" remains intact because the conversion event will be tied to the same unique identity. Focus on "User" metrics rather than "Session" metrics when analyzing cross-platform performance to avoid the noise created by device switching.
Consent signal propagation: web CMP to app SDK
Privacy regulations like GDPR and CCPA require that consent is respected across every touchpoint. A common mistake is treating the web and app as isolated islands for consent. If a user visits your website and denies tracking through your Consent Management Platform (CMP), that preference must be respected if they later move into your app.
This is known as consent propagation. When a user transitions from web to app via a deeplink, you should ideally pass a consent flag in the URL. The app can then read this flag and set the Firebase SDK's setAnalyticsCollectionEnabled or Google's Consent Mode parameters accordingly.
Warning: Many organizations fail to bridge the consent gap between the web CMP and the mobile SDK. If a user opts in on the web but your app SDK defaults to "denied" because it hasn't received a signal, you will lose app events for your most engaged users. Conversely, failing to propagate a "denied" signal to the app can lead to serious compliance violations.
Furthermore, on iOS, you must navigate Apple's App Tracking Transparency (ATT). Even if a user consents to analytics in your web CMP, you still need to show the native iOS ATT prompt if you intend to track them across other companies' apps and websites for advertising purposes. Your analytics strategy must account for the "Unknown" or "Denied" states that are common in the mobile ecosystem.
BigQuery unified export for cross-platform reporting
For advanced analysis, the standard GA4 interface is often insufficient. This is where the BigQuery export becomes invaluable. One of the greatest benefits of the unified property model is that GA4 exports all data streams into a single dataset and a consistent table structure.
Every day, GA4 pushes your raw event data into a table named events_YYYYMMDD. Within this table, you can distinguish between platforms using the platform column (which will show 'WEB', 'ANDROID', or 'IOS') and the stream_id.
Tip: Keeping web and app events in ONE
events_*table by linking them to the same GA4 property is significantly cleaner than having two separate exports. It eliminates the need for massiveUNION ALLqueries, which are prone to errors and consume more processing power, especially when your event parameters vary slightly between platforms.
Using SQL in BigQuery, you can perform sophisticated "Pathing" analysis. You can write a query to find every user who had a page_view on the web and then a first_open in the app within the same 24-hour period. This level of granularity is impossible in the standard UI and is the only way to truly calculate cross-platform attribution and retention.
Common mistakes we see
- Different Event Naming: The web team uses
purchasewhile the app team usesecommerce_purchase, leading to split metrics. - Inconsistent User ID Logic: Generating a User ID on the web based on an email hash, while using a database integer on the app. Stitching will fail if the values don't match exactly.
- Ignoring Apple's ATT: Assuming that web consent covers app tracking on iOS devices.
- Failing to link Firebase to GA4: Keeping app data in the Firebase console only, which prevents cross-platform deduplication.
- UTM Stripping: Using deeplinks that strip out marketing parameters, resulting in "Direct" traffic attribution for app installs.
- Not verifying the BigQuery schema: Assuming that parameters like
valueorcurrencyare being passed as the same data type across all streams. - Relying on Client ID: Using device-based IDs for reporting when a significant portion of the audience is multi-device.
Implementation checklist
- Create a single GA4 property and add distinct Data Streams for Web, iOS, and Android.
- Link your Firebase project(s) to the unified GA4 property.
- Develop a shared Tracking Plan (Event Taxonomy) that both web and mobile engineers must follow.
- Implement
user_idacross all platforms using a consistent, non-PII value from your auth system. - Enable Google Signals in GA4 settings to help with cross-device modeling where User IDs are missing.
- Configure Universal Links (iOS) and App Links (Android) to ensure attribution continuity.
- Implement a system to propagate consent signals from your web CMP to your mobile app SDK.
- Enable the BigQuery export for the GA4 property to ensure access to raw, cross-platform data.
- Set your "Reporting Identity" in GA4 to "Blended" to prioritize User-ID stitching.
- Audit your events using the GA4 DebugView on both web and mobile to ensure parameters are identical.
How Samarth Analytics helps
The technical barrier to entry for "true" cross-platform web and app analytics is high. It requires a deep understanding of web JavaScript, mobile SDKs, cloud infrastructure, and data privacy laws. Many organizations struggle to get their web and app teams to speak the same "data language," resulting in fragmented reports that nobody trusts.
At Samarth Analytics, we specialize in breaking down these silos. We act as the technical architect that ensures your Firebase and GA4 implementations are perfectly mirrored. Our team handles the heavy lifting - from setting up identity stitching and deeplink attribution to building custom BigQuery models that reveal the real value of your multi-device users. We don't just provide data; we provide the clarity needed to make confident marketing and product decisions.
Stop looking at your web and app as separate businesses. It is time to see your customers for who they really are. If you are ready to unify your data and unlock the full potential of GA4, reach out for a free audit of your current setup, or contact us to start your implementation today.