Overview

The OneSignal + Google AlloyDB integration enables automatic syncing of custom events from your AlloyDB database directly to OneSignal’s Custom Events API. This allows you to trigger automated Journeys and personalized messaging campaigns based on real user behavior stored in your database. You can sync events like purchases, product views, subscription changes, or any custom user actions to automatically trigger onboarding sequences, re-engagement campaigns, transactional messages, and targeted promotions across push notifications, email, in-app messages, and SMS.

Requirements

Google AlloyDB

  • Google Cloud Platform account with AlloyDB instance
  • Auth Proxy configured as required by Google Cloud
  • Database permissions to create users and grant access
  • Network access to your AlloyDB instance

Setup

Configure AlloyDB permissions

OneSignal needs to read event data from your AlloyDB database. We recommend creating a dedicated ONESIGNAL user account with read-only access to your event tables.
1

Create OneSignal database user

Create a dedicated user account with a strong, unique password:
-- Create the OneSignal user
CREATE USER ONESIGNAL WITH PASSWORD '<strong, unique password>';
2

Grant schema access

Grant the OneSignal user access to read from your event data schema:
-- Let the OneSignal user see your event schema
GRANT USAGE ON SCHEMA "<your_event_schema>" TO ONESIGNAL;

-- Let the OneSignal user read all existing tables in this schema
GRANT SELECT ON ALL TABLES IN SCHEMA "<your_event_schema>" TO ONESIGNAL;

-- Let the OneSignal user read any new tables added to this schema
ALTER DEFAULT PRIVILEGES IN SCHEMA "<your_event_schema>" GRANT SELECT ON TABLES TO ONESIGNAL;
Replace <your_event_schema> with the actual schema containing your event tables.
3

Grant function permissions (if needed)

If you use stored procedures or functions for event data:
-- Let the OneSignal user execute functions in this schema
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA "<your_event_schema>" TO ONESIGNAL;

-- Let the OneSignal user execute any new functions added to this schema
ALTER DEFAULT PRIVILEGES IN SCHEMA "<your_event_schema>" GRANT EXECUTE ON FUNCTIONS TO ONESIGNAL;

Set up Auth Proxy

1

Configure Auth Proxy

AlloyDB requires an Auth Proxy for third-party connections. Follow Google’s Auth Proxy documentation to set this up.
The Auth Proxy is required - OneSignal cannot connect directly to AlloyDB without it.
2

Note connection details

Save the following connection information:
  • Host: Auth Proxy endpoint
  • Port: Auth Proxy port (typically 5432)
  • Database: Your AlloyDB database name
  • Username: ONESIGNAL (created above)
  • Password: The password you set

Configure OneSignal AlloyDB connection

1

Navigate to integrations

In OneSignal, go to Data > Integrations and click Add Integration.
2

Select Google AlloyDB

Choose Google AlloyDB from the list of available integrations.
3

Enter connection details

Provide the AlloyDB connection information:
  • Host: Your Auth Proxy endpoint
  • Port: Auth Proxy port
  • Database: AlloyDB database name
  • Username: ONESIGNAL
  • Password: User password
  • SSL: Enabled (recommended)
4

Test the connection

Click Test Connection to verify OneSignal can access your AlloyDB instance.

Event Data Mapping

Once connected, you’ll need to map your AlloyDB table columns to OneSignal custom event fields:
1

Select event tables

Choose the tables containing your event data that you want to sync to OneSignal.
2

Map required event fields

Map the required fields for custom events:
  • Event Name: Column containing the event type (e.g., “purchase”, “signup”)
  • User Identifier: External User ID, Email, or Phone Number column
  • Event Timestamp: When the event occurred (optional)
3

Map event payload data

Map additional columns to event payload properties:
  • Custom event properties (product_id, price, category, etc.)
  • Contextual data (source, campaign, etc.)
  • Behavioral metrics (value, quantity, etc.)
4

Configure sync settings

Set your event processing frequency and delivery preferences.

Event data mapping

Map your to OneSignal’s custom events format:
OneSignal FieldDescriptionRequired
nameevent_nameEvent identifierYes
external_iduser_idUser identifierYes
timestampevent_timestampWhen event occurredNo
propertiesevent_dataNo

Advanced Network Configuration

IP Address Allowlists

If your AlloyDB instance uses IP allowlists, add OneSignal’s IP addresses. You can find the current IP ranges in your OneSignal dashboard under Data > Integrations > Network Access.

SSH Tunneling

OneSignal supports connecting to AlloyDB through SSH tunnels for additional security:
1

Create SSH user

Create a dedicated user account for OneSignal on your SSH host server.
2

Configure SSH tunnel

In the OneSignal AlloyDB connection settings, enable Use SSH Tunnel and provide:
  • SSH Host
  • SSH Port
  • SSH Username
3

Add SSH key

OneSignal will generate an SSH keypair. Copy the public key to your SSH host’s authorized_keys file for the OneSignal user.

Limitations

  • Performance: Avoid connecting to production databases during peak usage
  • Permissions: OneSignal requires read-only access to event tables
  • Auth Proxy: Required for all AlloyDB connections

FAQ

What happens if my event table structure changes?

OneSignal will detect schema changes and may require remapping of fields. Update your field mappings in the integration settings.

How often does OneSignal sync events?

OneSignal checks for new events based on your configured sync frequency, with a minimum interval of 15 minutes.

Need help?

Contact our support team at support@onesignal.com or use the in-app chat for assistance with your AlloyDB integration setup.