---
description: Measure user behavior in a Capacitor app with Firebase Analytics, covering setup, event and screen tracking, consent, and DebugView verification.
title: Track App Events with Firebase Analytics in Capacitor - Capawesome
image: https://capawesome.io/docs/assets/images/social/blog/capacitor-firebase-analytics-guide.png
---

<!doctype html> 

[Skip to content ](#track-app-events-with-firebase-analytics-in-capacitor) 

[📲 Introducing **Build Sharing** — get your builds onto testers' devices with a link & QR code. No account required. ](/blog/share-mobile-app-builds-with-testers/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Intercom ](/docs/sdks/capacitor/intercom/)
* [ Intune ](/docs/sdks/capacitor/intune/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Tauri ](/docs/sdks/capacitor/tauri/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ YouTube Player ](/docs/sdks/capacitor/youtube-player/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Notifications
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ Why Use Firebase Analytics in a Capacitor App? ](#why-use-firebase-analytics-in-a-capacitor-app)
* [ Before You Start ](#before-you-start)
* [ Step 1: Install the Plugin ](#step-1-install-the-plugin)
* [ Step 2: Add Firebase to Your Native Apps ](#step-2-add-firebase-to-your-native-apps)
* [ Track Screen Views in Angular, React, or Vue ](#track-screen-views-in-angular-react-or-vue)
* [ Run on a Device and Verify ](#run-on-a-device-and-verify)
* [ Firebase Analytics Best Practices ](#firebase-analytics-best-practices)
* [ Limitations ](#limitations)
* [ Common Errors and Troubleshooting ](#common-errors-and-troubleshooting)
* [ FAQ ](#faq)
* [ Ship Tracking Changes Without a Full Release ](#ship-tracking-changes-without-a-full-release)
* [ Conclusion ](#conclusion)

* Related links

# Track App Events with Firebase Analytics in Capacitor[¶](#track-app-events-with-firebase-analytics-in-capacitor "Permanent link")

Knowing what users actually do in your app, not just how many installed it, is the difference between guessing and deciding. The [Capacitor Firebase Analytics plugin](/docs/sdks/capacitor/firebase/analytics/) gives you Google's free, unlimited-volume analytics service behind one API for Android, iOS, and web.

This guide walks the whole thing end to end — installing and configuring the plugin, logging events and screen views, and verifying them in real time — plus the platform quirks that catch teams off guard and the parts of Firebase Analytics that are easy to get wrong in production.

[ ![Build and deploy your Capacitor app with Capawesome Cloud](https://capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1) ](/) 

## How to Add Firebase Analytics to a Capacitor App[¶](#how-to-add-firebase-analytics-to-a-capacitor-app "Permanent link")

Adding Firebase Analytics to a Capacitor app takes four steps:

1. **Install** `@capacitor-firebase/analytics` and the `firebase` package.
2. **Add the native config files** (`google-services.json` on Android, `GoogleService-Info.plist` on iOS) — Analytics starts collecting automatically once they're in place.
3. **Log events and screen views** with `logEvent()` and `setCurrentScreen()`.
4. **Verify in real time** with DebugView, since standard reports lag about an hour.

The rest of this guide covers each step in detail, plus consent, the platform quirks, and troubleshooting.

## What Is Firebase Analytics?[¶](#what-is-firebase-analytics "Permanent link")

[Firebase Analytics](https://firebase.google.com/docs/analytics) is Google's free app measurement service: event logging, audience segmentation, and conversion tracking, all reported in the Firebase console. The [Capacitor Firebase Analytics plugin](/docs/sdks/capacitor/firebase/analytics/) exposes the native Android and iOS Analytics SDKs, plus the Firebase JS SDK on web, behind one shared TypeScript API.

A working example can be found here: [capawesome-team/capacitor-firebase-plugin-demo](https://github.com/capawesome-team/capacitor-firebase-plugin-demo).

### Why Not Just Use the Firebase JS SDK?[¶](#why-not-just-use-the-firebase-js-sdk "Permanent link")

A few Analytics features have no equivalent in the web-only JS SDK running inside a WebView at all. On-device conversion measurement, matching an ad click to an app install using a hashed email or phone number, is iOS-native only and requires the native SDK. The same goes for the advertising ID (IDFA) handling covered below, which depends on Apple's native App Tracking Transparency framework, not something a WebView can intercept. For everything else, the native SDKs also just give you deeper platform integration (automatic screen tracking hooks, native session management) that the JS SDK can't replicate inside an embedded WebView.

Advanced Operations

This guide covers the operations most apps need. For every method with code samples, see the [Usage section of the plugin docs](https://capawesome.io/docs/sdks/capacitor/firebase/analytics/#usage).

## Why Use Firebase Analytics in a Capacitor App?[¶](#why-use-firebase-analytics-in-a-capacitor-app "Permanent link")

The plugin's own use cases map to five real scenarios:

**Event tracking.** Log app events with custom parameters using [logEvent(...)](/docs/sdks/capacitor/firebase/analytics/#logevent), like a sign-up or a purchase:

`[](#%5F%5Fcodelineno-0-1)import { FirebaseAnalytics } from '@capacitor-firebase/analytics';
[](#%5F%5Fcodelineno-0-2)
[](#%5F%5Fcodelineno-0-3)const logEvent = async () => {
[](#%5F%5Fcodelineno-0-4)  await FirebaseAnalytics.logEvent({
[](#%5F%5Fcodelineno-0-5)    name: 'sign_up',
[](#%5F%5Fcodelineno-0-6)    params: { method: 'password' },
[](#%5F%5Fcodelineno-0-7)  });
[](#%5F%5Fcodelineno-0-8)};
`

**Screen tracking.** Record which screens users visit with [setCurrentScreen(...)](/docs/sdks/capacitor/firebase/analytics/#setcurrentscreen):

`[](#%5F%5Fcodelineno-1-1)import { FirebaseAnalytics } from '@capacitor-firebase/analytics';
[](#%5F%5Fcodelineno-1-2)
[](#%5F%5Fcodelineno-1-3)const setCurrentScreen = async () => {
[](#%5F%5Fcodelineno-1-4)  await FirebaseAnalytics.setCurrentScreen({
[](#%5F%5Fcodelineno-1-5)    screenName: 'Login',
[](#%5F%5Fcodelineno-1-6)    screenClassOverride: 'LoginPage',
[](#%5F%5Fcodelineno-1-7)  });
[](#%5F%5Fcodelineno-1-8)};
`

**Audience segmentation.** Assign a user ID with [setUserId(...)](/docs/sdks/capacitor/firebase/analytics/#setuserid) and custom properties with [setUserProperty(...)](/docs/sdks/capacitor/firebase/analytics/#setuserproperty) to segment users in reports:

`[](#%5F%5Fcodelineno-2-1)import { FirebaseAnalytics } from '@capacitor-firebase/analytics';
[](#%5F%5Fcodelineno-2-2)
[](#%5F%5Fcodelineno-2-3)const setUserId = async () => {
[](#%5F%5Fcodelineno-2-4)  await FirebaseAnalytics.setUserId({ userId: '123' });
[](#%5F%5Fcodelineno-2-5)};
[](#%5F%5Fcodelineno-2-6)
[](#%5F%5Fcodelineno-2-7)const setUserProperty = async () => {
[](#%5F%5Fcodelineno-2-8)  await FirebaseAnalytics.setUserProperty({ key: 'language', value: 'en' });
[](#%5F%5Fcodelineno-2-9)};
`

**Consent management.** Set the user's consent mode with [setConsent(...)](/docs/sdks/capacitor/firebase/analytics/#setconsent) to comply with privacy requirements like GDPR:

`[](#%5F%5Fcodelineno-3-1)import { ConsentStatus, ConsentType, FirebaseAnalytics } from '@capacitor-firebase/analytics';
[](#%5F%5Fcodelineno-3-2)
[](#%5F%5Fcodelineno-3-3)const setConsent = async () => {
[](#%5F%5Fcodelineno-3-4)  await FirebaseAnalytics.setConsent({
[](#%5F%5Fcodelineno-3-5)    type: ConsentType.AnalyticsStorage,
[](#%5F%5Fcodelineno-3-6)    status: ConsentStatus.Denied,
[](#%5F%5Fcodelineno-3-7)  });
[](#%5F%5Fcodelineno-3-8)};
`

**Conversion measurement.** Initiate on-device conversion measurement with [initiateOnDeviceConversionMeasurementWithEmailAddress(...)](/docs/sdks/capacitor/firebase/analytics/#initiateondeviceconversionmeasurementwithemailaddress) or a phone number, iOS only:

`[](#%5F%5Fcodelineno-4-1)import { FirebaseAnalytics } from '@capacitor-firebase/analytics';
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const initiateOnDeviceConversionMeasurement = async () => {
[](#%5F%5Fcodelineno-4-4)  await FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithEmailAddress({
[](#%5F%5Fcodelineno-4-5)    emailAddress: 'mail@example.com',
[](#%5F%5Fcodelineno-4-6)  });
[](#%5F%5Fcodelineno-4-7)};
`

## Before You Start[¶](#before-you-start "Permanent link")

This guide assumes you already have a Capacitor app with the `android` and/or `ios` platforms added, and a Firebase project (create one in the [Firebase console](https://console.firebase.google.com/) if you haven't). Analytics needs no separate console setup — it starts collecting as soon as the SDK is wired up.

## Step 1: Install the Plugin[¶](#step-1-install-the-plugin "Permanent link")

Analytics uses the `firebase` package on the web layer, so install both, then sync:

`[](#%5F%5Fcodelineno-5-1)npm install @capacitor-firebase/analytics firebase
[](#%5F%5Fcodelineno-5-2)npx cap sync
`

## Step 2: Add Firebase to Your Native Apps[¶](#step-2-add-firebase-to-your-native-apps "Permanent link")

The plugin collects analytics through the native config files Firebase generates ([full reference](https://github.com/capawesome-team/capacitor-firebase/blob/main/docs/firebase-setup.md)):

* **Android** — register an Android app, download `google-services.json`, and place it in `android/app/google-services.json`.
* **iOS** — register an iOS app, download `GoogleService-Info.plist`, move it to `ios/App/App/GoogleService-Info.plist`, and drag it into the Xcode project (add it to all targets).
* **Web** — register a Web app and initialize the Firebase JS SDK with the config the console gives you.

On **iOS with Swift Package Manager**, add the SPM `symlink` package option to `capacitor.config.ts` to avoid a package identity collision (Capacitor CLI 8.4.0+); if you use **CocoaPods**, add the `CapacitorFirebaseAnalytics/Analytics` pod to your `Podfile`. This is also where you decide whether to collect Apple's advertising identifier (IDFA), because it's chosen at install time, not at runtime — see [Get IDFA/Advertising ID Handling Right on iOS](#get-idfaadvertising-id-handling-right-on-ios).

The plugin itself needs no additional configuration; once the config file is present, Analytics starts collecting automatically.

## Track Screen Views in Angular, React, or Vue[¶](#track-screen-views-in-angular-react-or-vue "Permanent link")

Firebase logs a `screen_view` event when you call [setCurrentScreen(...)](/docs/sdks/capacitor/firebase/analytics/#setcurrentscreen). In a single-page Capacitor app the cleanest place to call it is your router, so every navigation records a screen automatically:

AngularReactVue

`[](#%5F%5Fcodelineno-6-1)import { inject } from '@angular/core';
[](#%5F%5Fcodelineno-6-2)import { Router, NavigationEnd } from '@angular/router';
[](#%5F%5Fcodelineno-6-3)import { filter } from 'rxjs';
[](#%5F%5Fcodelineno-6-4)import { FirebaseAnalytics } from '@capacitor-firebase/analytics';
[](#%5F%5Fcodelineno-6-5)
[](#%5F%5Fcodelineno-6-6)// Call this once from your root component or an app initializer
[](#%5F%5Fcodelineno-6-7)export const trackScreens = () => {
[](#%5F%5Fcodelineno-6-8)  const router = inject(Router);
[](#%5F%5Fcodelineno-6-9)  router.events
[](#%5F%5Fcodelineno-6-10)    .pipe(filter((event): event is NavigationEnd => event instanceof NavigationEnd))
[](#%5F%5Fcodelineno-6-11)    .subscribe(event => {
[](#%5F%5Fcodelineno-6-12)      FirebaseAnalytics.setCurrentScreen({ screenName: event.urlAfterRedirects });
[](#%5F%5Fcodelineno-6-13)    });
[](#%5F%5Fcodelineno-6-14)};
`

`[](#%5F%5Fcodelineno-7-1)import { useEffect } from 'react';
[](#%5F%5Fcodelineno-7-2)import { useLocation } from 'react-router-dom';
[](#%5F%5Fcodelineno-7-3)import { FirebaseAnalytics } from '@capacitor-firebase/analytics';
[](#%5F%5Fcodelineno-7-4)
[](#%5F%5Fcodelineno-7-5)export const useScreenTracking = () => {
[](#%5F%5Fcodelineno-7-6)  const location = useLocation();
[](#%5F%5Fcodelineno-7-7)  useEffect(() => {
[](#%5F%5Fcodelineno-7-8)    FirebaseAnalytics.setCurrentScreen({ screenName: location.pathname });
[](#%5F%5Fcodelineno-7-9)  }, [location]);
[](#%5F%5Fcodelineno-7-10)};
`

`[](#%5F%5Fcodelineno-8-1)import { FirebaseAnalytics } from '@capacitor-firebase/analytics';
[](#%5F%5Fcodelineno-8-2)import router from './router';
[](#%5F%5Fcodelineno-8-3)
[](#%5F%5Fcodelineno-8-4)router.afterEach(to => {
[](#%5F%5Fcodelineno-8-5)  FirebaseAnalytics.setCurrentScreen({ screenName: to.path });
[](#%5F%5Fcodelineno-8-6)});
`

## Run on a Device and Verify[¶](#run-on-a-device-and-verify "Permanent link")

Analytics starts collecting automatically once the config file is in place — there's no console toggle to flip. Because standard reports batch for about an hour, verify with **DebugView** instead of waiting:

1. Enable debug mode on your device:
  * **Android:** `adb shell setprop debug.firebase.analytics.app <your.package.name>`
  * **iOS:** add `-FIRDebugEnabled` as a launch argument in your Xcode scheme.
2. Build and run: `npx cap run android` (or `npx cap run ios`).
3. Trigger some events in the app, then open **Analytics → DebugView** in the Firebase console — your events should appear within seconds.

If nothing shows up, it's almost always debug mode not enabled on the device, or the config file missing (Step 2).

## Firebase Analytics Best Practices[¶](#firebase-analytics-best-practices "Permanent link")

### Set Consent Before You Log Anything[¶](#set-consent-before-you-log-anything "Permanent link")

If you need consent management (GDPR, CCPA, or similar), call [setConsent(...)](/docs/sdks/capacitor/firebase/analytics/#setconsent) as early as possible in your app's startup, before any [logEvent(...)](/docs/sdks/capacitor/firebase/analytics/#logevent) calls. Consent state governs what gets collected going forward, so events logged before consent is set may capture more than you intended.

### Know Which Methods Are Platform-Specific[¶](#know-which-methods-are-platform-specific "Permanent link")

A few methods only work on some platforms, and the split isn't symmetric in the direction you'd expect: [isEnabled()](/docs/sdks/capacitor/firebase/analytics/#isenabled) only works on **Web**, while [resetAnalyticsData()](/docs/sdks/capacitor/firebase/analytics/#resetanalyticsdata) only works on **Android and iOS**. [setSessionTimeoutDuration(...)](/docs/sdks/capacitor/firebase/analytics/#setsessiontimeoutduration) is Android/iOS only, and `screenClassOverride` on `setCurrentScreen(...)` is also Android/iOS only. Don't assume a method that works on your dev machine (often web) will behave the same on device, or vice versa.

### Verify Events with DebugView Before You Ship[¶](#verify-events-with-debugview-before-you-ship "Permanent link")

Don't wait for the standard Firebase console reports to confirm your events are logging correctly. Standard reports batch events for about an hour before uploading, so you won't see immediate feedback. [DebugView](https://firebase.google.com/docs/analytics/debugview) uploads events with minimal delay instead, so you can validate an implementation in minutes instead of guessing for an hour.

### Get IDFA/Advertising ID Handling Right on iOS[¶](#get-idfaadvertising-id-handling-right-on-ios "Permanent link")

Disabling the Advertising ID on iOS isn't just a runtime call. You need the `CapacitorFirebaseAnalytics/AnalyticsWithoutAdIdSupport` pod (CocoaPods) or the `AnalyticsWithoutAdIdSupport` package trait (Swift Package Manager) instead of the default `Analytics` variant, chosen at install time, not at runtime. Get this wrong and you'll ship IDFA collection code you can't easily disable later without reinstalling the plugin dependency.

Keep in mind this plugin doesn't manage Apple's App Tracking Transparency (ATT) prompt itself. Even with the full IDFA-enabled variant installed, actually collecting the IDFA still requires the user to grant permission through that separate, app-level Apple requirement.

### Respect Firebase's Event Limits[¶](#respect-firebases-event-limits "Permanent link")

Firebase Analytics allows up to 500 distinct event _types_ per app, with no limit on the total volume of events logged. Event names are also case-sensitive: `sign_up` and `Sign_Up` are two different event types as far as Firebase is concerned, which silently fragments your data if you're not consistent about casing across your codebase.

## Limitations[¶](#limitations "Permanent link")

* [isEnabled()](/docs/sdks/capacitor/firebase/analytics/#isenabled) is only available on Web.
* [resetAnalyticsData()](/docs/sdks/capacitor/firebase/analytics/#resetanalyticsdata), [setSessionTimeoutDuration(...)](/docs/sdks/capacitor/firebase/analytics/#setsessiontimeoutduration), and the `screenClassOverride` option are only available on Android and iOS.
* [logTransaction(...)](/docs/sdks/capacitor/firebase/analytics/#logtransaction), for logging StoreKit 2 purchase transactions, and on-device conversion measurement are only available on iOS.
* [getAppInstanceId()](/docs/sdks/capacitor/firebase/analytics/#getappinstanceid) is only available on Android and iOS.

## Common Errors and Troubleshooting[¶](#common-errors-and-troubleshooting "Permanent link")

* **No events in the Firebase console.** Standard reports lag about an hour by design. Use [DebugView](https://firebase.google.com/docs/analytics/debugview) with debug mode enabled (above) for near-real-time confirmation.
* **No events even in DebugView.** Debug mode isn't enabled on the device, or the `google-services.json` / `GoogleService-Info.plist` is missing or misplaced (Step 2).
* **`isEnabled()` throws or does nothing on device.** It's **web-only**. Several methods are platform-restricted in the opposite direction too — check the [platform table](#know-which-methods-are-platform-specific) before assuming a method is broken.
* **Event counts look fragmented.** Event names are case-sensitive — `sign_up` and `Sign_Up` are different event types. Keep casing consistent across the codebase.
* **iOS builds pull in IDFA/ad tracking you didn't want.** The IDFA variant is chosen at install time via the pod/package trait, not at runtime — see [Get IDFA/Advertising ID Handling Right on iOS](#get-idfaadvertising-id-handling-right-on-ios).
* **Collection doesn't stop after a user opts out.** `setConsent(...)` only governs collection _going forward_ — call it before your first `logEvent(...)`, as early as possible on startup.

## FAQ[¶](#faq "Permanent link")

### How do I track screen views with Firebase Analytics in a Capacitor app?[¶](#how-do-i-track-screen-views-with-firebase-analytics-in-a-capacitor-app "Permanent link")

Call [setCurrentScreen(...)](/docs/sdks/capacitor/firebase/analytics/#setcurrentscreen) whenever the route changes. The cleanest place is your router, so every navigation logs a `screen_view` automatically — see [Track Screen Views in Angular, React, or Vue](#track-screen-views-in-angular-react-or-vue) for a per-framework example.

### Is Firebase Analytics free to use?[¶](#is-firebase-analytics-free-to-use "Permanent link")

Yes, unlike Firestore or Cloud Functions, Firebase Analytics has no usage-based billing at all. It's free with unlimited event volume, capped only by the 500-distinct-event-type limit mentioned above. That makes it one of the few Firebase products with no cost consideration when deciding whether to adopt it.

### Why don't my events show up immediately in the Firebase console?[¶](#why-dont-my-events-show-up-immediately-in-the-firebase-console "Permanent link")

Because standard Analytics reports batch events over roughly an hour before uploading them, by design, not because something is broken. If you need to confirm an event fired correctly right now, use [DebugView](https://firebase.google.com/docs/analytics/debugview) instead of waiting on the standard dashboard.

### What's the difference between `logEvent` and `logTransaction`?[¶](#whats-the-difference-between-logevent-and-logtransaction "Permanent link")

[logEvent(...)](/docs/sdks/capacitor/firebase/analytics/#logevent) is the general-purpose method for any custom event. [logTransaction(...)](/docs/sdks/capacitor/firebase/analytics/#logtransaction) is a specialized iOS-only method (15.0+) for logging a StoreKit 2 purchase transaction directly, which matters if you're using [in-app purchases](/blog/tips-for-setting-up-in-app-purchases-with-capacitor/) and want Firebase to attribute revenue events correctly without you manually re-implementing StoreKit's transaction data as a custom event.

## Ship Tracking Changes Without a Full Release[¶](#ship-tracking-changes-without-a-full-release "Permanent link")

Your event and screen tracking lives in your app's web layer, so refining what you measure — a renamed event, a new screen, a fixed parameter — doesn't have to wait on an app store review. [Capawesome Cloud](https://capawesome.io/) builds your iOS and Android apps in the cloud and pushes those web-layer changes straight to users with live updates, so your analytics can keep pace with the product instead of your release schedule — and it automates App Store and Play Store submission when you do ship natively.

[Book a Capawesome Cloud Demo](https://cal.com/team/capawesome/cloud-demo)

## Conclusion[¶](#conclusion "Permanent link")

Firebase Analytics' real value for a Capacitor app is that it's free, unlimited, and already wired into the rest of the Firebase ecosystem, at the cost of a few platform-specific quirks: `isEnabled()` is web-only, most of the interesting native features (session timeout, IDFA handling, StoreKit 2 transactions, on-device conversion) are Android/iOS-only, and the standard console reports lag behind real usage by about an hour.

If you want to go deeper from here:

* [Firebase Authentication in Capacitor: Setup & Best Practices](/blog/capacitor-firebase-authentication-guide/) — pair user IDs from Analytics with real signed-in users.
* [Capacitor Firestore: Real-Time Data & Offline Sync](/blog/capacitor-firebase-cloud-firestore-guide/) — the sibling Firebase plugin for storing and syncing your app's data.
* [Upload & Manage Files with Firebase Storage in Capacitor](/blog/capacitor-firebase-cloud-storage-guide/) — the sibling Firebase plugin for user-generated files.
* [How to Prepare Your App Store Listing](/blog/how-to-prepare-your-app-store-listing/) — covers declaring Analytics' data collection in Apple's Privacy Nutrition Labels and Google Play's Data Safety section, a commonly missed step.

Questions or something you ran into that isn't covered here? Drop into the [Capawesome Discord server](https://discord.gg/VCXxSVjefW) — and subscribe to the [Capawesome newsletter](https://capawesome.io/newsletter/) if you want the next deep-dive in your inbox.

July 29, 2026 

Back to top

```json
{
      "@context": "https://schema.org",
      "@type": "BlogPosting",
      "headline": "Track App Events with Firebase Analytics in Capacitor",
      "description": "Measure user behavior in a Capacitor app with Firebase Analytics, covering setup, event and screen tracking, consent, and DebugView verification.",
      "image": "https://capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png",
      "datePublished": "2026-08-01T00:00:00+00:00",
      "dateModified": "2026-08-01T00:00:00+00:00",
      "author": [
        {
          "@type": "Person",
          "name": "Dayana Jabif",
          "url": "https://github.com/djabif"
        }
      ],
      "publisher": {
        "@type": "Organization",
        "name": "Capawesome",
        "url": "https://capawesome.io",
        "logo": {
          "@type": "ImageObject",
          "url": "https://capawesome.io/assets/images/logo.svg"
        }
      },
      "articleSection": "Capacitor",
      "keywords": ["Capacitor", "Firebase", "Guides", "SDKs"],
      "isPartOf": {
        "@type": "Blog",
        "@id": "https://capawesome.io/blog/#blog"
      },
      "mainEntityOfPage": "https://capawesome.io/blog/capacitor-firebase-analytics-guide/",
      "url": "https://capawesome.io/blog/capacitor-firebase-analytics-guide/"
    }
{
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://capawesome.io/"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Blog",
          "item": "https://capawesome.io/blog/"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "Track App Events with Firebase Analytics in Capacitor",
          "item": "https://capawesome.io/blog/capacitor-firebase-analytics-guide/"
        }
      ]
    }
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "What Is Firebase Analytics?", "acceptedAnswer": {"@type": "Answer", "text": "Firebase Analytics is Google's free app measurement service: event logging, audience segmentation, and conversion tracking, all reported in the Firebase console. The Capacitor Firebase Analytics plugin exposes the native Android and iOS Analytics SDKs, plus the Firebase JS SDK on web, behind one shared TypeScript API. A working example can be found here: capawesome-team/capacitor-firebase-plugin-demo."}}, {"@type": "Question", "name": "Why Not Just Use the Firebase JS SDK?", "acceptedAnswer": {"@type": "Answer", "text": "A few Analytics features have no equivalent in the web-only JS SDK running inside a WebView at all. On-device conversion measurement, matching an ad click to an app install using a hashed email or phone number, is iOS-native only and requires the native SDK. The same goes for the advertising ID (IDFA) handling covered below, which depends on Apple's native App Tracking Transparency framework, not something a WebView can intercept. For everything else, the native SDKs also just give you deeper platform integration (automatic screen tracking hooks, native session management) that the JS SDK can't replicate inside an embedded WebView. Advanced Operations This guide covers the operations most apps need. For every method with code samples, see the Usage section of the plugin docs."}}, {"@type": "Question", "name": "Why Use Firebase Analytics in a Capacitor App?", "acceptedAnswer": {"@type": "Answer", "text": "The plugin's own use cases map to five real scenarios: Event tracking. Log app events with custom parameters using logEvent(...), like a sign-up or a purchase: import { FirebaseAnalytics } from '@capacitor-firebase/analytics'; const logEvent = async () => { await FirebaseAnalytics. logEvent ({ name: 'sign_up', params: { method: 'password' }, }); }; Screen tracking. Record which screens users visit with setCurrentScreen(...): import { FirebaseAnalytics } from '@capacitor-firebase/analytics'; const setCurrentScreen = async () => { await FirebaseAnalytics. setCurrentScreen ({ screenName: 'Login', screenClassOverride: 'LoginPage', }); }; Audience segmentation. Assign a user ID with setUserId(...) and custom properties with setUserProperty(...) to segment users in reports: import { FirebaseAnalytics } from '@capacitor-firebase/analytics'; const setUserId = async () => { await FirebaseAnalytics. setUserId ({ userId: '123' }); }; const setUserProperty = async () => { await FirebaseAnalytics. setUserProperty ({ key: 'language', value: 'en' }); }; Consent management. Set the user's consent mode with setConsent(...) to comply with privacy requirements like GDPR: import { ConsentStatus, ConsentType, FirebaseAnalytics } from '@capacitor-firebase/analytics'; const setConsent = async () => { await FirebaseAnalytics. setConsent ({ type: ConsentType. AnalyticsStorage, status: ConsentStatus.Denied, }); }; Conversion measurement. Initiate on-device conversion measurement with initiateOnDeviceConversionMeasurementWithEmailAddress(...) or a phone number, iOS only: import { FirebaseAnalytics } from '@capacitor-firebase/analytics'; const initiateOnDeviceConversionMeasurement = async () => { await FirebaseAnalytics. initiateOnDeviceConversionMeasurementWithEmailAddress ({ emailAddress: 'mail@example.com', }); };"}}, {"@type": "Question", "name": "How do I track screen views with Firebase Analytics in a Capacitor app?", "acceptedAnswer": {"@type": "Answer", "text": "Call setCurrentScreen(...) whenever the route changes. The cleanest place is your router, so every navigation logs a screen_view automatically — see Track Screen Views in Angular, React, or Vue for a per-framework example."}}, {"@type": "Question", "name": "Is Firebase Analytics free to use?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, unlike Firestore or Cloud Functions, Firebase Analytics has no usage-based billing at all. It's free with unlimited event volume, capped only by the 500-distinct-event-type limit mentioned above. That makes it one of the few Firebase products with no cost consideration when deciding whether to adopt it."}}, {"@type": "Question", "name": "Why don't my events show up immediately in the Firebase console?", "acceptedAnswer": {"@type": "Answer", "text": "Because standard Analytics reports batch events over roughly an hour before uploading them, by design, not because something is broken. If you need to confirm an event fired correctly right now, use DebugView instead of waiting on the standard dashboard."}}, {"@type": "Question", "name": "What's the difference between logEvent and logTransaction?", "acceptedAnswer": {"@type": "Answer", "text": "logEvent(...) is the general-purpose method for any custom event. logTransaction(...) is a specialized iOS-only method (15.0+) for logging a StoreKit 2 purchase transaction directly, which matters if you're using in-app purchases and want Firebase to attribute revenue events correctly without you manually re-implementing StoreKit's transaction data as a custom event."}}], "url": "https://capawesome.io/blog/capacitor-firebase-analytics-guide/"}
```
