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
- Go to the Firebase Console.
- Click Add project (or select an existing project).
- Enter a project name (e.g. “My App - Production”).
- Choose whether to enable Google Analytics for the project (recommended — this is required for the Measurement ID).
- 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
- In your Firebase project dashboard, click the Web icon (
</>) to add a web app. - Enter an app nickname (e.g. “Production Website”).
- Optionally enable Firebase Hosting.
- Click Register app.
- 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
- apiKey — this is your
Step 3: Find Your Measurement ID
- In the Firebase Console, go to Analytics > Data Streams (or Project Settings > Integrations > Google Analytics).
- Select your web data stream.
- 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
- In the Firebase Console, go to Analytics > Data Streams.
- Select your web data stream.
- Scroll down to Measurement Protocol API secrets.
- Click Create to generate a new API secret.
- 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
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Your Firebase project ID. Found in Project Settings > General (e.g. my-app-project-123). |
api_key | secret | Yes | The Firebase Web API key. Found in Project Settings > General > Web API Key. |
app_id | string | Yes | The Firebase App ID for your web app. Found in Project Settings > Your apps (e.g. 1:1234567890:web:abc123def456). |
measurement_id | string | Yes | The GA4 Measurement ID linked to this Firebase project. Found in Analytics > Data Streams (e.g. G-XXXXXXXXXX). |
Management UI Setup
- Go to Integrations in the sidebar.
- Open the Integration Library tab.
- Find Firebase or filter by Analytics.
- 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.
- 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 Event | Firebase Event | Notes |
|---|---|---|
page (page view) | page_view | Maps page URL, title, referrer as event parameters |
Product Viewed | view_item | Product details mapped to items array |
Product Added | add_to_cart | Product details mapped to items array |
Product Removed | remove_from_cart | Product details mapped to items array |
Checkout Started | begin_checkout | Cart value, currency, items included |
Order Completed | purchase | Revenue, transaction ID, items mapped |
Products Searched | search | Search term mapped to search_term parameter |
| Custom events | Passed through | Custom 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:
- In the Firebase Console, go to Analytics > DebugView.
- DebugView shows events arriving in real-time, including event parameters.
- Check the Events section in Analytics to see aggregate event counts (may take up to 24 hours for full processing).
- Use the Realtime report in the linked GA4 property for immediate verification.
- 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
| Symptom | Cause | Fix |
|---|---|---|
| No events in Realtime report | Incorrect Measurement ID | Verify the Measurement ID matches your data stream in Analytics > Data Streams |
403 authentication error | Invalid or missing API secret | Generate a new Measurement Protocol API secret in your data stream settings |
| Events arrive but parameters are missing | Parameter names do not match GA4 schema | Check that parameter names use underscores and are within the 40-character limit |
Revenue not tracked on purchase events | Missing value or currency parameter | Ensure Order Completed events include total (or revenue) and currency properties |
| Event names appearing as custom events | Standard event name mismatch | Verify that Datafly event names map correctly to GA4 recommended event names |
400 bad request | Malformed JSON payload | Check Datafly Signal delivery logs for the full error message |
| Events delayed by hours | GA4 processing lag | Standard 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.