Firebase is a comprehensive app development platform developed by Google that provides a suite of tools and services to help developers build, improve, and grow their applications. It offers functionalities like a real-time database, authentication, cloud storage, analytics, and machine learning. Firebase is known for its ease of integration, scalability, and the ability to synchronize data across multiple clients. It supports both mobile and web applications, making it a versatile choice for developers.
Product Type: Analytics
Integration Type: Starter Kit
Event Source Type: Mobile App
Event Scope: Full-Funnel Events
- Acts as an add-on to MetaRouter's Google Analytics 4 integration, extending app and web analytics.
- Sends commerce events to GA4 via the Measurement Protocol for app event tracking.
- Provides a unified view of user journeys across web and mobile platforms.
- Supports GA4's event-based tracking for detailed analysis and attribution.
- This integration is an add-on to the MetaRouter Google Analytics 4 integration and requires it to be set up first (see Prerequisites).
- Authentication uses a GA4 Measurement Protocol API secret and a Firebase App ID, both sent as query parameters.
- The
app_instance_id is fetched via the Firebase SDK and is different from a web client_id.
- Identify, screen, and page events are not supported and are filtered out.
- A
user_id can be added as a Global or Event Specific mapping to improve cross-platform user matching when available.
- Before integrating, complete the prerequisites:
- Google Analytics 4 must be integrated with MetaRouter.
- The GTAG sync must be integrated with MetaRouter.
- The Firebase SDK must be installed in your apps.
- Firebase and Google Analytics 4 must be connected.
- Then gather the following:
- API Secret: In the Google Analytics UI, go to Admin > Data Streams > choose your stream > Measurement Protocol > Create. This secret is confidential; do not share it publicly or embed it in client-side code.
- Firebase App ID: In the Firebase console, open your project, go to Project Settings > General > Your Apps, select the app, and copy the App ID.
- From the integration library, add a Firebase integration. Then, fill out the Connection Parameters:
| Connection Parameter | Description |
|---|
API_SECRET | Each data stream has a unique API Secret for sending data via the GA4 Measurement Protocol. |
FIREBASE_APP_ID | A unique identifier for your app within the Firebase platform. |
- MetaRouter provides all of the event mappings that Firebase integrations typically require. You may add custom events, parameters, or mappings in accordance with Firebase's API documentation.
- In the Pipelines tab, add your Firebase integration.
- Select the correct integration revision.
- Click Add Integration to finalize deployment.
Global mappings will be applied to all events. If your parameter names do not match the Expected Inputs provided, you will need to overwrite the Inputs provided with your own.
| Output Key | Description | Expected Input |
|---|
app_instance_id Required | String: A unique identifier for a Firebase app instance, fetched via the Firebase SDK. Different from a web client_id. | context.providers.googleFirebase.appInstanceId |
non_personalized_ads | Boolean: When true, serves ads using contextual information rather than user-specific data to support privacy compliance. | context.providers.googleFirebase.nonPersonalizedAds |
| Output Key | Description | Expected Input |
|---|
events Required | Array of Objects: Builds a search event with the search term. | Expression – builds the GA4 event array from properties |
| Output Key | Description | Expected Input |
|---|
events Required | Array of Objects: Builds a view_item_list event with currency, coupon, list ID, and an items array (ID, name, index, category, affiliation, price) per product. | Expression – builds the GA4 event array from properties |
| Output Key | Description | Expected Input |
|---|
events Required | Array of Objects: Builds a view_item event with currency, value, and the item's ID and name. | Expression – builds the GA4 event array from properties |
| Output Key | Description | Expected Input |
|---|
events Required | Array of Objects: Builds an add_to_cart event with currency, value, and the item's ID and name. | Expression – builds the GA4 event array from properties |
| Output Key | Description | Expected Input |
|---|
events Required | Array of Objects: Builds a view_cart event with currency, coupon, running total value, and an items array (ID, name, index, category, affiliation, price, quantity) per product. | Expression – builds the GA4 event array from properties.products |
| Output Key | Description | Expected Input |
|---|
events Required | Array of Objects: Builds a begin_checkout event with currency, coupon, running total value, and an items array per product. | Expression – builds the GA4 event array from properties.products |
| Output Key | Description | Expected Input |
|---|
events Required | Array of Objects: Builds a purchase event with currency, coupon, transaction ID, running total value, and an items array (ID, name, index, category, affiliation, price, quantity) per product. | Expression – builds the GA4 event array from properties.products |
These identifiers must be mapped to Firebase in order for successful user matching to occur. Without these IDs, any events sent to Firebase will be rejected. For your convenience, required and recommended IDs are mapped as Global parameters to ensure they are added to every event.
| Attribute | Example | Sync Injector Required? |
|---|
app_instance_id Required | cHJvZHVjdF9pZD1maXJlYmFzZToyMDE2MTA1OCZhcHBfaW… | No |
Coordinate with your Firebase representative, or use the GA4 DebugView and reporting, to confirm that events are being received and processed correctly on their backend.