IntegrationsDatabasesGoogle Firestore

Google Firestore

Datafly Signal delivers events to Google Cloud Firestore for flexible, scalable NoSQL document storage with real-time sync capabilities and offline support.

Prerequisites

Before configuring Google Firestore in Signal, you need a GCP project with a Firestore database, a target collection, and a service account.

Create a GCP Account and Project

  1. Sign up at cloud.google.com if you don’t already have an account.
  2. Create a new project or select an existing one in the GCP Console.
  3. Note the Project ID.

Create a Firestore Database

  1. Go to the Firestore console.
  2. If prompted, click Create database.
  3. Choose the Firestore mode:
    • Native mode — recommended for Signal. Provides real-time listeners, offline support, and document-based queries.
    • Datastore mode — optimised for server-side workloads, no real-time features.
  4. Select a Location close to your Signal deployment.
  5. Click Create database.
⚠️

The Firestore mode cannot be changed after creation. Choose Native mode for the most flexibility.

Define a Collection

Firestore collections are created automatically when the first document is written. However, you can optionally create the collection structure in advance:

  1. In the Firestore console, click Start collection.
  2. Enter the Collection ID (e.g. events).
  3. Add a sample document or click Auto-ID and Save (you can delete this placeholder later).

Signal will create documents in the specified collection automatically. Each event becomes a separate document with the message_id as the document ID.

Create a Service Account

  1. Go to IAM & Admin > Service Accounts > Create Service Account.
  2. Enter a name (e.g. datafly-signal-firestore).
  3. Grant the Cloud Datastore User role (roles/datastore.user) — this role covers both Firestore Native and Datastore mode.
  4. Click Done.

Generate a Service Account Key

  1. Click on the service account.
  2. Go to Keys > Add Key > Create new key > JSON.
  3. The key file will download. Store it securely.
⚠️

Store the JSON key file securely. Do not commit it to version control.

Configuration

FieldTypeRequiredDescription
project_idstringYesThe Google Cloud project ID that contains the Firestore database.
collectionstringYesThe Firestore collection name to write documents to.
service_account_jsonsecretYesThe full JSON key file content for a GCP service account with Firestore permissions.

Signal Setup

Quick Setup

  1. Navigate to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Google Firestore or filter by Cloud Storage.
  4. Click Install, select a variant if available, and fill in the required fields.
  5. Click Install Integration to create the integration with a ready-to-use default blueprint.

API Setup

curl -X POST http://localhost:8084/v1/admin/integration-catalog/google_firestore/install \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Google Firestore",
    "variant": "default",
    "config": {
      "project_id": "datafly-analytics",
      "collection": "events",
      "service_account_json": "{\"type\": \"service_account\", ...}"
    },
    "delivery_mode": "server_side"
  }'

Testing

  1. Enable the integration in Signal and trigger a test event on your website.
  2. Open the Firestore console and navigate to the events collection.
  3. Verify that event documents are appearing with the correct fields and data.
  4. Click on individual documents to inspect the full event payload.
  5. In Signal, check the Live Events view to confirm delivery status shows as successful.

Troubleshooting

ProblemSolution
Events not appearing in FirestoreVerify the project ID, collection name, and service account JSON are correct.
Permission denied (403)The service account lacks the Cloud Datastore User role. Add it in IAM & Admin > IAM.
NOT_FOUNDThe Firestore database has not been created in this project. Create it in the Firestore console.
Invalid service account JSONEnsure you pasted the complete JSON key file content.
RESOURCE_EXHAUSTEDYou have exceeded Firestore write quotas. Check the quotas page and consider batching.
Wrong Firestore modeIf the database is in Datastore mode, the collection structure differs. Verify the mode in the Firestore console.
Document size limitIndividual Firestore documents cannot exceed 1 MB. Check the event payload size.

Visit Google Firestore documentation for full API reference, security rules, and query best practices.