Linking Google Sheets as a source

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

Learn more
PostHog Wizard hedgehog

Contents

The Google Sheets connector can link your spreadsheets in to PostHog to be queryable.

Syncing a worksheet

Each Google Sheets source in PostHog is a single spreadsheet where each worksheet is represented as a schema.

Changing the name of a worksheet will require you to setup the schema in PostHog again to continue syncing it. We recommend not renaming worksheets.

The first row of the spreadsheet is treated as the column names for the table.

Column headers are normalized when creating table columns — casing, spaces, and punctuation are ignored. Headers that look different in the sheet (e.g., Task ID and task_id) may collapse to the same column name. If this happens, the sync fails with an error identifying the conflicting headers. Rename one of the colliding headers in your sheet and resync.

Configure Google Sheets

To connect to your Google Sheet, PostHog uses a Google Cloud service account. Thus, you must grant this service account access to your Google Sheet by following these steps:

  1. Open your Google Sheet.
  2. Navigate to Share.
  3. Share the sheet with our service account by entering google-sheets@posthog-external.iam.gserviceaccount.com into the Add people field. We only require "Viewer" permissions to sync the sheet.

Configuring PostHog

  1. Go to the sources tab of the data pipeline section in PostHog.

  2. Click + New source and then click Link next to Google Sheets.

  3. Enter the Google Sheets URL of the sheet you want to sync and hit Next.

  4. On the next page, set up the worksheets you want to sync and modify the method and frequency as needed. Once done, click Import.

Once the syncs are complete, you can start using Google Sheets data in PostHog.

Configuration

OptionDescription
Spreadsheet URL
Type: text
Required: True

Share the sheet with our service account by entering google-sheets@posthog-external.iam.gserviceaccount.com into the "Add people" field. We only require "Viewer" permissions to sync the sheet.

Supported tables

The tables available from this source are discovered from your account when you connect it, so the exact list depends on your data. Once connected, you can pick which tables to sync from the sources tab.

Incremental and append only syncs

To enable incremental or append only syncs of your spreadsheet, we require a numerical id column with auto-incrementing values. This can be achieved by using the formula =ROW() in a column with the column header (row 1) being set to id. This will then sync only newly added rows to PostHog

Community questions

Was this page useful?