Google BigQuery reverse ETL

Best Practices

Before you add a Reverse ETL source, you should take some measures to ensure the security of your customers’ data and limit performance impacts to your database and Customer.io workspace.

  • Create a new database user/service account. Implement a database user with minimal privileges specifically for Customer.io import/sync operations. This account only requires read permissions with access limited to the tables you want to sync from.

  • Avoid using your main database instance. Consider creating a read-only database instance with replication in place, lightening the load and preventing data loss on your main instance.

  • Sync only the data that you’ll use in Customer.io. Limiting your query can improve performance, and minimizes the potential to expose sensitive data. Select only the columns you care about, and make sure you use the {{last_sync_time}} to limit your query to data that changed since the previous sync.

  • Limit your sync frequency so you don’t sync more than necessary and consume unnecessary resources. If the previous reverse ETL operation is still in progress when the next interval occurs, we’ll skip the operation and catch up your data on the next interval. You should monitor your first few reverse ETL intervals to ensure that your sync doesn’t impact your system’s security and performance—frequently skipped operations may indicate that you’re syncing too often.

Sending excessive data can impact your account's performance

You should not run queries that return large data sets—millions of rows—more than once per day. Doing so may impact workspace performance, including delaying automations and messages.

Sending DATETIME values as Unix timestamps

In Customer.io, you need to format timestamps as Unix epochs to full take advantage of them. If you store date and times as DATETIME in Big Query you can use UNIX_SECONDS(column_name) AS column_name to convert the DATETIME values to Unix timestamps.

Granting us access to your database

As a part of setup, you'll need to provide the credentials of a database user with read-access to the tables you want to select data from.

If you use a firewall or an allowlist, you must allow the following IP addresses so we can connect to your database. Make sure you use the correct IP addresses for your account region.

US RegionEU Region
34.29.50.434.22.168.136
35.222.130.20934.78.194.61
34.122.196.49104.155.37.221
34.9.152.5334.78.153.242
34.170.216.13134.78.94.137
35.222.84.13134.140.151.135
34.57.129.12734.62.147.132

Set up a Google BigQuery Service Account

When you set up a Google BigQuery reverse ETL, you’ll need to provide a Service Account key. This grants Customer.io access to your BigQuery project and gives you control over the level of access you want to grant. You’ll need to set up the service account in BigQuery.

  1. In the Google BigQuery, go to IAM & Admin > Service Accounts and click Create Service Account.
  2. Enter a name and description for the account, and then click Create and Continue.
  3. In the Grant this service account access to project section, select the BigQuery User role you want to add.
  4. Click Add another role and add the BigQuery Job User role.
  5. Click Continue and then click Done.
  6. Find the service account you just created, click the 3 dots under Actions, and select Manage keys.
  7. Click Add Key > Create new key.
  8. Select JSON for the key type and click Create. This downloads a key file to your computer.
  9. Open the file you just downloaded and copy the contents.
  10. When setting up your integration, you’ll copy these credentials in the Service Account Credentials field.

Set up your Google BigQuery integration

Set up your integration with an AI agent

Connect your AI coding agent to Customer.io’s MCP or the CLI. When you add this integration in the Customer.io UI, you’ll see a prompt under Set up with an agent that you can pass to your coding agent. With the Customer.io MCP or CLI tools, these prompts can help you set up your integration with minimal effort.

As a part of this setup, you’ll provide Customer.io with user credentials that we’ll use to query your database. We recommend that you create a new user with Read Only access specifically for Customer.io, so you can manage Customer.io access to your database independent of any other Google BigQuery users you have.

  1. Go to Integrations. In the Directory tab, pick Google BigQuery.

  2. Provide your database information, including credentials to connect to your database, and click Save database.

    • The Name is a friendly name you’ll use to recognize your database whenever you reference it in Customer.io
    • Add your service account credentials in JSON format. See Set up a Google BigQuery Service Account above for help setting up a service account.
    connect your database
  3. Set up a Sync. A sync is the type of data (identify, track, etc) you want to import from your database and click Next: Define Query. You can set up syncs for each type of data you want to import.

    1. Provide a Name and Description for the sync. This helps you understand the sync at a glance when you look at your integration’s Overview later.
    2. Select the type of data you want to import.
    3. Set the Sync Frequency, indicating how often you want to query your database for new data. You should set the frequency such that sync operations don’t overlap. Learn more about sync frequency.
    4. Select when you want to start the sync: whether you want to begin importing data immediately, or schedule the sync to start at a later date.
      add a sync and determine the data you want to capture
  4. Enter the query that selects the data you want to import. See Queries for each sync type for what each sync type expects and for examples written for your database. Click Run Query to preview results and make sure that your query selects the right information.

    set up your query to sync the right information
  5. Click Enable to enable your sync.

Now you can set up additional syncs and connect your integration to one or more destinations.

Dataset location

You don’t need to choose a location for your BigQuery syncs. BigQuery runs each query in the location of the datasets that the query reads. When all the datasets in your query are in the same location, you can sync data from any BigQuery location. To join datasets from different locations in one query, your project needs to meet Google’s global query requirements.

When BigQuery can’t find a table or dataset that your query reads, the preview can show an error like “BigQuery can’t find the table acme-prod:analytics.users”. The error also names the location where BigQuery looked. Check that:

  • The project, dataset, and table names in your query match the names in BigQuery.
  • The dataset is in the location that the error names.
  • Your service account can read the dataset.

If BigQuery can’t work out a location from the datasets in your query, it looks in your BigQuery default location, or US if you haven’t set one. So when the error names US but your dataset is in another location, start with the names in your query and your service account’s access.

Adding syncs

After you set up your incoming integration, you can add additional syncs to import different types of data from your database. For example, you might want to import identify data for your users, and track data for their actions. Subsequent syncs can rely on your existing database, or you can add another database within your integration.

  1. In your integration, go to the Syncs tab and click Add Sync.
  2. Select your database or add a new one and click Next: Create Sync.
  3. Set up a sync and click Next: Define Query. You can set up syncs for each type of data you want to import.
    1. Provide a Name and Description for the sync. This helps you understand the sync at a glance when you look at your integration’s Overview later.
    2. Select the type of data you want to import.
    3. Set the Sync Frequency, indicating how often you want to query your database for new data. You should set the frequency such that sync operations don’t overlap. Learn more about sync frequency.
    4. Select when you want to start the sync: whether you want to begin importing data immediately, or schedule the sync to start at a later date.
      add a sync and determine the data you want to capture
  4. Enter the query that selects the data you want to import. See Queries for each sync type for what each sync type expects and for examples written for your database. Click Run Query to preview results and make sure that your query selects the right information.
    set up your query to sync the right information
  5. Click Enable to enable your sync.

Sync Frequency

You can sync data as often as every minute. However, we recommend that you set your sync frequency such that sync operations don’t overlap. If you schedule syncs such that a sync operation is scheduled to start while the previous operation is still we’ll skip the next sync operation.

Each sync runs your query in BigQuery, so your sync frequency affects your BigQuery bill:

  • On on-demand pricing: BigQuery bills each query for the data it scans, with a 10 MB minimum per table. A sync that scans a whole large table costs the same whether it returns one row or a million.
  • Scan less per sync: Select only the columns you need, and partition or cluster your table on the column you compare to last_sync_time. Filtering on a column that isn’t partitioned or clustered limits the rows a sync returns, not the data it scans.
  • On capacity pricing: Syncs use your slots instead. With a fixed number of slots, frequent syncs queue behind other workloads rather than add to your bill. If your reservation autoscales, they can add billed autoscaling slots.

Semantic events: Deleting people, groups, and more

You may notice that this integration doesn’t have sync types to delete people, groups, or other objects. To do these kinds of operations, you’ll use what we call semantic events. These are events with specific names that indicate a delete operation. When your Track sync picks up events with an event name we recognize, we’ll perform the associated action—like deleting a person or group.

For example, if you send an event with the name User Deleted, we’ll delete the person from your workspace. See Customer.io Semantic Events for more information.

The semantic events we support are:

Event NameAction
Device Created or UpdatedAdd or update a mobile device.
Device DeletedDelete a mobile device.
User DeletedDelete a person.
Object DeletedDelete a custom object.
Relationship DeletedDelete a relationship.
User SuppressedSuppress a person.
User UnsuppressedUnsuppress a person.
Report Delivery EventReport in-app message events (like delivery, open, click) outside of our JavaScript integration.
Updated December 1, 2026