OneSignal and BigQuery integration overview


Overview

The OneSignal + BigQuery integration supports two powerful data pipelines:
  • Export: Automatically send messaging event data (push, email, SMS, in-app) from OneSignal to BigQuery for analysis and reporting.
  • Import: Sync custom user events from your BigQuery datasets to OneSignal to trigger automated Journeys and personalized messaging.
Together, these integrations give you complete control over user engagement data—powering advanced analytics and real-time behavior-driven messaging.

Export OneSignal events to BigQuery

Send messaging performance and engagement events (e.g., sends, opens, clicks) to BigQuery to:
  • Build custom dashboards and reports
  • Track delivery and engagement trends across channels
  • Combine OneSignal data with other business data for analysis
Requirements
  • Google Cloud Platform project with billing enabled
  • BigQuery enabled in your GCP project
  • Service account with BigQuery write permissions
Setup Steps

1. Create a Service Account

1

Log in to your Google Cloud Platform account

After you login, ensure the proper project is selected.
2

Create a service account

Visit the Create Service Account page and click Create Service Account.
3

Fill out the fields.

Give it any name and service account ID you choose.
4

Assign the 'BigQuery User' role

Give the service account the “BigQuery User” role.
5

Create a JSON key for this account

Go to your new service account > Keys > Add Key > Create new key > select JSON. Save the file.
You’ll paste the entire contents of this JSON key file into OneSignal to activate the integration.

2. Activate the Integration in OneSignal

1

Go to OneSignal > Data > Integrations > BigQuery

2

Paste your service account JSON key

3

Configure settings

  • Sync Frequency: As often as every 15 minutes
  • Dataset/Table Names: Customize if needed
  • Event Types: Select specific message events (e.g., sent, opened, clicked)
    • Note: You can select multiple event types or update selected events at a later time.
4

Click Save and wait for confirmation

Initial data sync can take 15–30 minutes to appear in BigQuery.While you wait, send messages via push, email, in-app, or SMS to trigger the events selected.

3. View Data in BigQuery

Open your BigQuery console and locate the dataset (e.g., onesignal_events_<app-id>) to explore synced message events.

BigQuery dataset containing exported message events

Message events and properties

Message event kinds

Property: event_kind Type: String The kind of message and event (e.g. message.push.received, message.push.sent).
Message Event (OneSignal)event_kindDescription
Push Sentmessage.push.sentPush notification successfully sent.
Push Receivedmessage.push.receivedDelivered push (see Confirmed Delivery).
Push Clickedmessage.push.clickedUser clicked the push.
Push Failedmessage.push.failedDelivery failure. See message reports.
Push Unsubscribedmessage.push.unsubscribedUser unsubscribed from push.
In-App Impressionmessage.iam.displayedIn-App message shown.
In-App Clickedmessage.iam.clickedIn-App message clicked.
In-App Page Viewedmessage.iam.pagedisplayedIn-App page shown.
Email Sentmessage.email.sentEmail delivered.
Email Receivedmessage.email.receivedEmail accepted by recipient’s mail server.
Email Openedmessage.email.openedEmail opened. See Email Reports.
Email Link Clickedmessage.email.clickedLink in email clicked.
Email Unsubscribedmessage.email.unsubscribedRecipient unsubscribed.
Email Marked Spammessage.email.resporedasspamMarked as spam. See Email Deliverability.
Email Bouncedmessage.email.hardbouncedBounce due to permanent delivery failure.
Email Failedmessage.email.failedDelivery failed.
Email Suppressedmessage.email.supressedSuppressed due to suppression list.
SMS Sentmessage.sms.sentSMS sent.
SMS Deliveredmessage.sms.deliveredSMS successfully delivered.
SMS Failedmessage.sms.failedSMS failed to deliver.
SMS Undeliveredmessage.sms.undeliveredSMS rejected or unreachable.

Event data schema

For each message event generated by a user, the following metadata will be attached to the record.
Column NameTypeDescription
event_idUUIDUnique identifier for the event
event_timestampTimestampTime of event occurrence
event_kindStringThe Event Kind
subscription_device_typeStringDevice type (e.g., iOS, Android, Web, Email, SMS)
languageStringSubscription language code
versionStringIntegration version
device_osStringDevice operating system version
device_typeNumberNumeric device type
tokenStringPush token, phone number, or email
subscription_idUUIDSubscription ID
subscribedBooleanSubscription status
onesignal_idUUIDOneSignal user ID
last_activeStringLast active timestamp
sdkStringOneSignal SDK version
external_idStringExternal user ID that should match the integration user ID
app_idUUIDApp ID from OneSignal
template_idUUIDTemplate ID (if applicable)
message_idUUIDMessage batch/request ID
message_nameStringName of the message
message_titleStringMessage title (English only)
message_contentsStringTruncated message body (English only)
_created, _id, _index, _fivetran_syncedInternal useFivetran sync metadata

Notes

  • Syncs after saving/activating may take an additional 15-30 minutes to complete.
  • Deactivating may still result in one final sync after deactivation.
  • To ensure efficient data synchronization, our system automatically creates and manages staging datasets. These datasets, named with a pattern like fivetran_{two random words}_staging, temporarily store data during processing before it’s integrated into your main schema. These staging datasets are essential for maintaining a streamlined workflow and should not be deleted, as they will be automatically recreated.

Import events from BigQuery

Send behavioral event data from BigQuery to OneSignal to:
  • Trigger Journeys based on user activity
  • Personalize messaging based on behavioral data
Requirements
  • GCP project with BigQuery and event data tables
  • Service account with read permissions
  • Event data tables containing behavioral data in BigQuery datasets
Setup Steps
1

Create BigQuery service account

OneSignal will generate a service account automatically when you create the connection. Alternatively, you can provide your own service account key JSON file.If creating your own service account, ensure it has the required permissions listed below.
2

Grant required permissions

The OneSignal service account needs these BigQuery IAM roles:
  • bigquery.dataViewer - Read access to datasets and tables containing event data
  • bigquery.jobUser - Permission to create jobs for data queries
  • bigquery.metadataViewer - Project-level metadata access (recommended)
Grant permissions using the Google Cloud Console or CLI:
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
  --member serviceAccount:ONESIGNAL_SERVICE_ACCOUNT_EMAIL \
  --role roles/bigquery.dataViewer

gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
  --member serviceAccount:ONESIGNAL_SERVICE_ACCOUNT_EMAIL \
  --role roles/bigquery.jobUser
3

Add integration in OneSignal

In OneSignal, go to Data > Integrations and click Add Integration.Select Google BigQuery and provide:
  • Google Cloud Project ID: Your GCP project containing BigQuery datasets
  • Dataset Region: Location where your BigQuery datasets are stored
  • Service Account Key (optional): JSON key file if using your own service account
4

Configure event data source

Specify the BigQuery dataset and table containing your event data:
  • Dataset: BigQuery dataset name (e.g., analytics_events)
  • Table/View: Table or view containing event records
  • Event Query: Optional SQL query to filter or transform event data
Your event table should contain columns for:
  • Event name/type
  • User identifier
  • Event timestamp
  • Additional event properties
5

Test the connection

Click Test Connection to verify OneSignal can access your BigQuery project and read event data.

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 configuration

Custom SQL Queries

Use custom SQL to filter or transform event data before syncing to OneSignal:
SELECT
  event_name,
  user_id,
  event_timestamp,
  STRUCT(
    product_id,
    purchase_amount,
    category
  ) as payload
FROM `project.dataset.events`
WHERE event_timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)

Cross-Project Access

If your event data spans multiple BigQuery projects, grant the OneSignal service account access to each project containing referenced tables or views.
Your BigQuery connection region must match the specific table region for optimal performance.

FAQ

Why do I see multiple message IDs for the same content?

This typically occurs when a message template is reused across multiple sends or triggered flows.

How often does OneSignal sync data?

Both export and import integrations can sync as frequently as every 15 minutes.

Can I use BigQuery views?

Yes. Just make sure the service account has access to all referenced tables in the view.