Firebase

Server-side event delivery to Firebase Analytics (Google Analytics for Firebase) via the Measurement Protocol for web and mobile app analytics.

⚠️

This integration is currently in beta. Configuration and behaviour may change.

Prerequisites

Before configuring Firebase in Datafly Signal, you need a Firebase project with a web app registered and the associated GA4 Measurement ID.

Step 1: Create a Firebase Project

  1. Go to the Firebase Console.
  2. Click Add project (or select an existing project).
  3. Enter a project name (e.g. “My App - Production”).
  4. Choose whether to enable Google Analytics for the project (recommended — this is required for the Measurement ID).
  5. Select your Google Analytics account and click Create project.

If you already have a Google Analytics 4 property, you can link it to your Firebase project during creation. Firebase Analytics and GA4 share the same underlying data.

Step 2: Register a Web App

  1. In your Firebase project dashboard, click the Web icon (</>) to add a web app.
  2. Enter an app nickname (e.g. “Production Website”).
  3. Optionally enable Firebase Hosting.
  4. Click Register app.
  5. Firebase will display your app configuration. Copy the following values:
    • apiKey — this is your api_key
    • projectId — this is your project_id
    • appId — this is your app_id

Step 3: Find Your Measurement ID

  1. In the Firebase Console, go to Analytics > Data Streams (or Project Settings > Integrations > Google Analytics).
  2. Select your web data stream.
  3. Copy the Measurement ID in the format G-XXXXXXXXXX.
⚠️

The Measurement ID is required for server-side event delivery via the GA4 Measurement Protocol. Without it, events will not be associated with your Firebase Analytics property.

Step 4: Get the Measurement Protocol API Secret

  1. In the Firebase Console, go to Analytics > Data Streams.
  2. Select your web data stream.
  3. Scroll down to Measurement Protocol API secrets.
  4. Click Create to generate a new API secret.
  5. Copy the secret value — this is used to authenticate server-side requests.

The Measurement Protocol API secret is different from the Firebase API key. The API secret is required for server-side event delivery, while the Firebase API key is used for client-side SDK initialization.

API Endpoint

POST https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}

Events are sent as JSON payloads using the GA4 Measurement Protocol. Authentication is handled via the api_secret query parameter.

Configuration

FieldTypeRequiredDescription
project_idstringYesYour Firebase project ID. Found in Project Settings > General (e.g. my-app-project-123).
api_keysecretYesThe Firebase Web API key. Found in Project Settings > General > Web API Key.
app_idstringYesThe Firebase App ID for your web app. Found in Project Settings > Your apps (e.g. 1:1234567890:web:abc123def456).
measurement_idstringYesThe GA4 Measurement ID linked to this Firebase project. Found in Analytics > Data Streams (e.g. G-XXXXXXXXXX).

Management UI Setup

  1. Go to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Firebase or filter by Analytics.
  4. Click Install and fill in the required fields:
    • Enter your Project ID from Step 2.
    • Paste your API Key from Step 2.
    • Enter your App ID from Step 2.
    • Enter your Measurement ID from Step 3.
  5. Click Install Integration to create the integration with a ready-to-use default blueprint.

Management API Setup

curl -X POST http://localhost:8084/v1/admin/integration-catalog/firebase/install \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Firebase",
    "variant": "default",
    "config": {
      "project_id": "my-app-project-123",
      "api_key": "your_api_key",
      "app_id": "1:1234567890:web:abc123def456",
      "measurement_id": "G-XXXXXXXXXX"
    },
    "delivery_mode": "server_side"
  }'

Event Mapping

Datafly Signal maps standard events to Firebase Analytics event names:

Datafly EventFirebase EventNotes
page (page view)page_viewMaps page URL, title, referrer as event parameters
Product Viewedview_itemProduct details mapped to items array
Product Addedadd_to_cartProduct details mapped to items array
Product Removedremove_from_cartProduct details mapped to items array
Checkout Startedbegin_checkoutCart value, currency, items included
Order CompletedpurchaseRevenue, transaction ID, items mapped
Products SearchedsearchSearch term mapped to search_term parameter
Custom eventsPassed throughCustom event names sent as-is with all properties as parameters

Firebase Analytics event names must be alphanumeric with underscores (no spaces or special characters). Datafly Signal automatically converts event names to the correct format (e.g. Order Completed becomes purchase for standard events).

Testing

Once your integration is active and events are flowing, verify in Firebase:

  1. In the Firebase Console, go to Analytics > DebugView.
  2. DebugView shows events arriving in real-time, including event parameters.
  3. Check the Events section in Analytics to see aggregate event counts (may take up to 24 hours for full processing).
  4. Use the Realtime report in the linked GA4 property for immediate verification.
  5. In Datafly Signal, check the Delivery Logs for the Firebase integration to verify successful API responses.
⚠️

DebugView only shows events from debug-enabled devices by default. Server-side events sent via the Measurement Protocol may not appear in DebugView — use the GA4 Realtime report instead.

Troubleshooting

SymptomCauseFix
No events in Realtime reportIncorrect Measurement IDVerify the Measurement ID matches your data stream in Analytics > Data Streams
403 authentication errorInvalid or missing API secretGenerate a new Measurement Protocol API secret in your data stream settings
Events arrive but parameters are missingParameter names do not match GA4 schemaCheck that parameter names use underscores and are within the 40-character limit
Revenue not tracked on purchase eventsMissing value or currency parameterEnsure Order Completed events include total (or revenue) and currency properties
Event names appearing as custom eventsStandard event name mismatchVerify that Datafly event names map correctly to GA4 recommended event names
400 bad requestMalformed JSON payloadCheck Datafly Signal delivery logs for the full error message
Events delayed by hoursGA4 processing lagStandard reports can take 24-48 hours; use Realtime or DebugView for immediate checks

Delivery

Events are delivered server-side from your Datafly Signal infrastructure directly to the GA4 Measurement Protocol API. No client-side Firebase scripts are loaded for this integration.

Visit the Firebase Analytics documentation and the GA4 Measurement Protocol reference for full API reference and advanced configuration options.