Analytics
View Google Analytics reports linked to your Firebase project with configurable dimensions and metrics.
Overview
The Analytics view in Stackpane lets you run Google Analytics 4 (GA4) reports directly from the app. Select dimensions, metrics, and date ranges to generate reports for your Firebase project’s linked GA4 property — without switching to the Google Analytics web console.
Stackpane uses the Google Analytics Data API to fetch report data and the Firebase Management API to discover which GA4 property is linked to your project. All data is read-only; Stackpane does not modify your analytics configuration.
Prerequisites
Stackpane uses the Google Analytics Data API and the Firebase Management API to power this feature. Both must be enabled in your Google Cloud project. Your Firebase project must also be linked to a Google Analytics 4 (GA4) property.
- Enable in Console:
- Enable via CLI:
gcloud services enable analyticsdata.googleapis.com firebase.googleapis.com --project YOUR_PROJECT_ID
- Required IAM role: Firebase Analytics Viewer (
roles/firebase.analyticsViewer) for read access to analytics data - Cost notes: Google Analytics is free. The Analytics Data API has a default quota of 50 requests per project per day for the v1beta endpoint. If you run many reports, you may need to request a quota increase in the Google Cloud Console Quotas page.
- Additional requirement: Your Firebase project must be linked to a GA4 property. See Linking a GA4 Property to Firebase below if this is not yet configured.
Common Errors
“Analytics not available”: This can occur when (1) the Google Analytics Data API is not enabled, (2) the Firebase Management API is not enabled, or (3) your Firebase project is not linked to a GA4 property. Enable both APIs using the CLI command above, and verify the GA4 link in the Firebase Console under Project Settings > Integrations > Google Analytics.
How Stackpane Discovers Your GA4 Property
When you navigate to the Analytics section, Stackpane performs the following steps automatically:
- Queries the Firebase Management API to retrieve your project’s linked analytics account and GA4 property ID.
- Resolves the GA4 property to obtain the property’s numeric identifier used by the Analytics Data API.
- Validates access by confirming that your credentials have permission to read data from the GA4 property.
If any step fails, Stackpane displays an error message with guidance on how to resolve it. The most common issue is that no GA4 property is linked to the Firebase project — see the Setup Troubleshooting section below.
Running Analytics Reports
Selecting Dimensions
Dimensions describe the attributes of your data. Choose one or more dimensions for your report:
| Dimension | API Name | Description |
|---|---|---|
| Date | date | Calendar date of the event (YYYYMMDD format) |
| Country | country | Country of the user based on IP geolocation |
| City | city | City of the user based on IP geolocation |
| Device Category | deviceCategory | Device type: desktop, mobile, or tablet |
| Operating System | operatingSystem | User’s operating system (iOS, Android, Windows, macOS, etc.) |
| Browser | browser | User’s browser name (Chrome, Safari, Firefox, etc.) |
| Platform | platform | App platform: web, iOS, or Android |
| Page Path | pagePath | URL path of the page viewed (web only) |
| Screen Name | unifiedScreenName | Screen name for mobile app or page title for web |
| Event Name | eventName | Name of the analytics event |
| Source | sessionSource | Traffic source (e.g., google, direct, newsletter) |
| Medium | sessionMedium | Traffic medium (e.g., organic, cpc, referral) |
| Campaign | sessionCampaignName | Marketing campaign name |
Select dimensions from the dimension picker in the report builder. You can combine multiple dimensions in a single report (for example, Date + Country to see daily user counts by country).
Selecting Metrics
Metrics are the quantitative measurements in your report. Choose one or more metrics:
| Metric | API Name | Description |
|---|---|---|
| Active Users | activeUsers | Number of distinct users who engaged with your app or site |
| Sessions | sessions | Total number of sessions |
| Screen Page Views | screenPageViews | Total page views (web) and screen views (mobile) combined |
| Event Count | eventCount | Total number of events triggered |
| New Users | newUsers | Number of first-time users |
| Engaged Sessions | engagedSessions | Sessions lasting longer than 10 seconds or with a conversion event |
| Engagement Rate | engagementRate | Percentage of sessions that were engaged sessions |
| Average Session Duration | averageSessionDuration | Mean session length in seconds |
| Conversions | conversions | Total number of conversion events |
| Total Revenue | totalRevenue | Combined revenue from purchases, subscriptions, and ads |
| Crash Free Users Rate | crashFreeUsersRate | Percentage of users who did not experience a crash |
Select metrics from the metric picker. Combining metrics like Active Users + Sessions + Engagement Rate gives a quick overview of user engagement.
Date Ranges
Configure the time period for your report:
- Select a start date using the date picker.
- Select an end date using the date picker.
- The report fetches data for all days within the range, inclusive.
Common ranges like “Last 7 days”, “Last 28 days”, and “Last 90 days” are available as quick-select options.
Generating the Report
- Select your desired dimensions and metrics.
- Set the date range.
- Click Run Report to execute the query.
- Results are displayed in a sortable table with the selected dimensions as row identifiers and metrics as columns.
Click column headers to sort by any dimension or metric. Large result sets are paginated.
Pre-defined Report Templates
Stackpane includes report templates for common analytics scenarios. Select a template to auto-populate the dimensions, metrics, and date range:
| Template | Dimensions | Metrics | Default Range |
|---|---|---|---|
| User Overview | Date | Active Users, New Users, Sessions | Last 28 days |
| Engagement Summary | Date | Sessions, Engaged Sessions, Engagement Rate, Average Session Duration | Last 28 days |
| Geographic Breakdown | Country, City | Active Users, Sessions | Last 7 days |
| Device Report | Device Category, Operating System | Active Users, Sessions, Screen Page Views | Last 7 days |
| Traffic Sources | Source, Medium | Sessions, Engaged Sessions, Conversions | Last 28 days |
| Top Pages | Page Path | Screen Page Views, Active Users, Average Session Duration | Last 7 days |
| Top Events | Event Name | Event Count, Active Users | Last 7 days |
Templates are a starting point. After selecting a template, you can modify the dimensions, metrics, and date range before running the report.
Exporting Report Data
Export the results of any report for further analysis:
- Run a report with your desired configuration.
- Click the Export button in the report toolbar.
- Save the data as a CSV or JSON file.
Exported files include all rows and columns from the current report, including any applied sorting.
Limitations
- Production only: Analytics is not available for emulator connections. The Firebase Emulator Suite does not simulate Google Analytics. The Analytics section is hidden when an emulator connection is active.
- GA4 only: Stackpane supports Google Analytics 4 properties. Legacy Universal Analytics (UA) properties are not supported, as Google has sunset the UA platform.
- API quota: The Google Analytics Data API v1beta has a default quota of 50 requests per project per day. If you run many reports, you may need to request a quota increase in the Google Cloud Console Quotas page.
- Data latency: GA4 data may be delayed by up to 24—48 hours for some metrics. Real-time event data is not available through the Data API.
- Read-only: Stackpane does not create, modify, or delete analytics events, conversions, or property configuration. All operations are read-only.
Setup Troubleshooting
Linking a GA4 Property to Firebase
If your Firebase project does not have a linked GA4 property:
- Open the Firebase Console and select your project.
- Click the gear icon and go to Project Settings.
- Navigate to the Integrations tab.
- Under Google Analytics, click Enable Google Analytics.
- Select an existing GA4 property or create a new one.
- Click Enable to complete the linking.
After linking, return to Stackpane and navigate to Analytics. Stackpane will detect the newly linked property automatically.
Enabling the Required APIs
If you see an “API not enabled” error in the Analytics section:
- Confirm which API is missing from the error message.
- Enable the API using the CLI:
gcloud services enable analyticsdata.googleapis.com --project YOUR_PROJECT_ID
gcloud services enable firebase.googleapis.com --project YOUR_PROJECT_ID
- Wait 1—2 minutes for the API to activate.
- Click Refresh in Stackpane or reconnect.
”No analytics property found”
Cause: The Firebase Management API did not return a linked GA4 property for your project.
Fix:
- Verify that the GA4 property is linked in the Firebase Console (see above).
- Ensure the Firebase Management API (
firebase.googleapis.com) is enabled. - Check that your account has permission to view the project’s analytics settings.
”Permission denied” on Analytics
Cause: Your account does not have the role needed to query the GA4 property.
Fix:
- Assign the Firebase Analytics Viewer role (
roles/firebase.analyticsViewer) to your account. - Alternatively, the Firebase Viewer role or Firebase Editor role includes analytics read permissions.
- If using a service account, make sure the service account is granted access at both the Firebase project level and the GA4 property level.
No Data in Reports
If reports return empty results:
- Check the date range: Ensure the selected dates overlap with a period when your app was actively sending analytics events.
- Verify data collection: Confirm that your app has the Firebase Analytics SDK integrated and is sending events.
- Wait for processing: Newly linked GA4 properties may take up to 24 hours to show historical data. Events begin flowing immediately, but aggregated report data may be delayed.
- Check filters: If using dimensions like Country or Device Category, ensure there is data matching those breakdowns in your selected date range.
Tips
- Start with the User Overview template to get a quick sense of your project’s traffic and growth
- Use the Date dimension in combination with other dimensions to see trends over time
- Export reports as CSV for further analysis in spreadsheets or data tools
- If you hit the daily API quota limit, prioritize the reports you need most and run them in a single session
- Combine Source and Medium dimensions to understand which marketing channels drive the most engaged traffic
- Check the Geographic Breakdown template to understand where your users are located, which can inform localization decisions