IntegrationsDatabasesGoogle Cloud SQL

Google Cloud SQL

Datafly Signal delivers events to Google Cloud SQL for fully managed relational database storage on Google Cloud, supporting MySQL, PostgreSQL, and SQL Server engines.

Prerequisites

Before configuring Google Cloud SQL in Signal, you need a GCP project with a Cloud SQL instance, a database and table, and a database user.

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.

Enable the Cloud SQL Admin API

  1. Go to APIs & Services > Library.
  2. Search for Cloud SQL Admin API.
  3. Click Enable.

Create a Cloud SQL Instance

  1. Go to the Cloud SQL console.
  2. Click Create Instance.
  3. Choose a database engine: MySQL, PostgreSQL, or SQL Server.
  4. Enter an Instance ID (e.g. datafly-events).
  5. Set the Root password (or default user password).
  6. Select a Region and Zone.
  7. Choose a Machine type based on your expected workload.
  8. Under Connections, configure:
    • Public IP — enable if Signal connects from outside GCP. Add authorised networks (Signal’s IP addresses).
    • Private IP — enable if Signal runs within the same VPC.
  9. Click Create Instance.
  10. Note the Instance connection name from the instance overview (format: project:region:instance).

The instance connection name (e.g. datafly-analytics:us-central1:datafly-events) is used by the Cloud SQL Auth Proxy and is the primary identifier for Signal’s connection.

Configure Authorised Networks

If using public IP:

  1. Open the Cloud SQL instance details.
  2. Go to Connections > Networking > Authorised networks.
  3. Click Add a network.
  4. Enter the IP addresses of your Signal deployment.
  5. Click Save.

Create a Database and Table

Connect to the instance and create the target database and table. For PostgreSQL:

CREATE DATABASE datafly_events;
 
\c datafly_events
 
CREATE TABLE events (
  event_id VARCHAR(64) PRIMARY KEY,
  type VARCHAR(20),
  event VARCHAR(256),
  anonymous_id VARCHAR(64),
  user_id VARCHAR(256),
  timestamp TIMESTAMPTZ,
  received_at TIMESTAMPTZ,
  context JSONB,
  properties JSONB,
  traits JSONB,
  source_id VARCHAR(64),
  integration_id VARCHAR(64)
);
 
CREATE INDEX idx_events_timestamp ON events (timestamp DESC);

Create a Database User for Signal

CREATE USER datafly_signal WITH PASSWORD 'your_secure_password';
GRANT INSERT ON TABLE events TO datafly_signal;

Configuration

FieldTypeRequiredDescription
connection_namestringYesThe instance connection name (e.g. project:region:instance).
databasestringYesThe target database name.
table_namestringYesThe target table name to insert rows into.
usernamestringYesThe database username for authentication.
passwordsecretYesThe database password for authentication.

Signal Setup

Quick Setup

  1. Navigate to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Google Cloud SQL 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_cloud_sql/install \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Google Cloud SQL",
    "variant": "default",
    "config": {
      "connection_name": "datafly-analytics:us-central1:datafly-events",
      "database": "datafly_events",
      "table_name": "events",
      "username": "datafly_signal",
      "password": "your_secure_password"
    },
    "delivery_mode": "server_side"
  }'

Testing

  1. Enable the integration in Signal and trigger a test event on your website.
  2. Connect to the Cloud SQL instance and query the target table:
SELECT * FROM events ORDER BY timestamp DESC LIMIT 10;
  1. Verify that event rows are appearing with correct data.
  2. In Signal, check the Live Events view to confirm delivery status shows as successful.

Troubleshooting

ProblemSolution
Events not appearing in the tableVerify the connection name, database, and table name are correct.
Connection refused / timeoutCheck that Signal’s IP is in the authorised networks list. If using private IP, verify VPC connectivity.
Authentication failedThe username or password is incorrect. Verify the credentials.
INSERT permission deniedThe database user lacks INSERT permission. Run GRANT INSERT ON TABLE events TO datafly_signal;.
Relation does not existThe table does not exist. Verify the table name and that it was created in the correct database.
Connection name format errorThe connection name must be in the format project:region:instance. Check the Cloud SQL instance overview page.
SSL/TLS errorsCloud SQL connections use SSL by default. Ensure your Signal deployment supports the required TLS version.

Visit Google Cloud SQL documentation for full API reference, connection methods, and backup configuration.