Google Firebase

📘

This integration is currently in beta. Contact your MetaRouter support team to get started.

What Is Firebase?

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


Capabilities

  • 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.

Considerations

  • 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.

Starter Kit Setup Guide

1. Gather Credentials

  • 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.

2. Add a Firebase Integration

  • From the integration library, add a Firebase integration. Then, fill out the Connection Parameters:
Connection ParameterDescription
API_SECRETEach data stream has a unique API Secret for sending data via the GA4 Measurement Protocol.
FIREBASE_APP_IDA unique identifier for your app within the Firebase platform.

3. Configure Event Mapping

  • 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.

4. Deploy to Pipeline

  • In the Pipelines tab, add your Firebase integration.
  • Select the correct integration revision.
  • Click Add Integration to finalize deployment.

Event Mappings

Global

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 KeyDescriptionExpected Input
app_instance_id RequiredString: 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_adsBoolean: When true, serves ads using contextual information rather than user-specific data to support privacy compliance.context.providers.googleFirebase.nonPersonalizedAds

Event Specific

Products Searched

Output KeyDescriptionExpected Input
events RequiredArray of Objects: Builds a search event with the search term.Expression – builds the GA4 event array from properties

Product List Viewed

Output KeyDescriptionExpected Input
events RequiredArray 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

Product Viewed

Output KeyDescriptionExpected Input
events RequiredArray 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

Product Added

Output KeyDescriptionExpected Input
events RequiredArray 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

Cart Viewed

Output KeyDescriptionExpected Input
events RequiredArray 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

Checkout Started

Output KeyDescriptionExpected Input
events RequiredArray 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

Order Completed

Output KeyDescriptionExpected Input
events RequiredArray 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

Required & Recommended Identifiers

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.

AttributeExampleSync Injector Required?
app_instance_id RequiredcHJvZHVjdF9pZD1maXJlYmFzZToyMDE2MTA1OCZhcHBfaW…No

Integration Validation

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.


Additional Firebase Documentation