✅ Source ❌ Destination
With HG Insights + BigQuery, send your engagement, intent or CRM data to HG Platform.
What does this integration do?
Turning on the BigQuery integration allows you to send BigQuery data to HG Platform: product usage, web visits, contact properties to surface to your Sales reps in the HG Platform iFrame in Salesforce or leverage in a scoring model.
Authentication options
HG Platform supports two ways to authenticate your BigQuery connection. Choose the one that fits your GCP setup.
Option A: Service Account (recommended)
Uses a GCP service account key - no user session involved, no periodic re-authentication required. This is the most reliable option for a persistent background integration.
GCP setup (your team):
Create a service account in a GCP project.
Grant
roles/bigquery.jobUseron the billing project.Grant
roles/bigquery.metadataViewerat the data project level +roles/bigquery.dataVieweron the target dataset (orroles/bigquery.dataViewerat project level to cover both).Generate a JSON key file.
HG Platform setup:
Log in to HG Platform and go to Integrations > BigQuery.
Select Service Account at Step 0 of the setup.
Paste the JSON key file contents at Step 1 and complete the setup.
Option B: OAuth + Trusted App Exemption
Uses a Google OAuth flow tied to a user account. By default, Google Workspace enforces a session control policy on Cloud-scoped OAuth apps (including BigQuery) with a maximum session length of 24 hours - meaning the connection would break at least once a day and require manual re-authentication.
This option only works if your Google Workspace IT admin exempts HG Insights as a trusted app, which disables the session timeout for this specific app. Without that exemption, OAuth is not suitable for a persistent integration.
Your IT admin setup (required before connecting):
In the Google Workspace Admin Console, go to Security > Access and data control > Google Cloud session control.
Mark the HG Insights app as Trusted in the App access control page.
Enable the Exempt trusted apps checkbox in the Cloud session control settings.
HG Platform setup (once IT has completed the above):
Log in to HG Platform and go to Integrations > BigQuery.
Select OAuth at Step 0 and follow the Google authentication flow.
Data setup requirements
Data in BigQuery resides in tables. When sharing data with HG Platform, the best practice is to create separate tables for each object type. You don't need to send all three - only what your use case requires:
Contact attributes only: a contact table is sufficient.
Account attributes only: an account table is sufficient.
Events or intent data: both an event table and a contact table are required, so HG Platform can reconcile events with a contact's email across integrations (format for anonymous intent:
anonymous@domain.com).
Each table must include created_at and updated_at timestamp columns. HG Platform pulls data incrementally - new rows via created_at, updated rows via updated_at.
⚠️ Please make sure your created_at and updated_at timestamps are accurate ⚠️
All timestamps must be in UTC.
created_at and updated_at fields must record the actual write time of the record on your BigQuery table (whether it is initial creation or edit). Past or future timestamps are incompatible with our ingestion logic.
Our ingestion system stores the most recent created_at and updated_at timestamps it retrieved. During the following pull, it continues by selecting records whose timestamps exceed those thresholds. Consequently, if you add an event to the table with an outdated created_at timestamp — meaning it does not represent the actual moment you create/edit the record in the table, you may unintentionally suppress your events from our ingestion.
Scope: The integration uses https://www.googleapis.com/auth/bigquery. Other scopes such as cloud-platform are not compatible. To restrict HG Platform's access to specific datasets and tables, configure those permissions on the service account (or OAuth user) in BigQuery directly.
What Objects can you send to HG Platform?
HG Platform works with the following entities and required properties (if the naming doesn't match exactly these column you'll be able to map them in HG Platform but they need to be in there):
Contacts
Column | Type | example | Comment |
|---|---|---|---|
id | VARCHAR(256) | 93d8AB4f69fa80 | Required (Can be equal to the email field) |
VARCHAR(256) | john@slack.com | Required | |
created_at | TIMESTAMP | 2023-12-02 20:23:12.010000 | Required. UTC |
updated_at | TIMESTAMP | 2023-12-02 20:23:12.010000 | Required. UTC |
contact_{property} | depends on the property can be numeric or varchar or boolean | Optional. |
Events
Column | Type | example | Comment |
|---|---|---|---|
id | VARCHAR(256) | 03492f12-061b-4f54-b866-764b4f69fa80 | Required |
event_name | VARCHAR(256) | logged_in | Required |
event_timestamp | TIMESTAMP | 2023-12-02 20:22:51.780000 | Required |
contact_id | VARCHAR(256) | 93d8AB4f69fa80 / john@slack.com | Required (needs to match “id” in Contacts table) |
created_at | TIMESTAMP | 2023-12-02 20:23:12.010000 | Required |
updated_at | TIMESTAMP | 2023-12-02 20:23:12.010000 | Required |
event_{property} | depends on the property can be numeric or varchar or boolean | Optional |
Accounts
Column | Type | example | Comment |
|---|---|---|---|
id | VARCHAR(256) | RECAB4f6 | Required |
domain | VARCHAR(256) | slack.com | Required |
created_at | TIMESTAMP | 2023-12-02 20:23:12.010000 | Required. UTC |
updated_at | TIMESTAMP | 2023-12-02 20:23:12.010000 | Required. UTC |
account_{property} | depends on the property can be numeric or varchar or boolean | Optional. |
After connecting
Pre-requisite
You have access to your BigQuery account and to HG Platform app
For HG Platform to start pulling data from your BigQuery account, please follow the following steps:
Log in to HG Platform.
Click on Integrations > BigQuery.
Click on Grant access to Google BigQuery and follow the setup flow.
Once connected you'll see a form asking for Project ID, Dataset, Location, and the table names corresponding to Events, Contacts or Accounts.
For each object, map your BigQuery table column names corresponding to the required properties.
Click Save.
Click on Test connection to check HG Platform can connect to your dataset.
HG Platform will start pulling data moving forward! For HG Platform to pull historical data on these tables, please submit a support ticket - it's a quick configuration to turn on on our end.
At any time, you can see the status of the integration in Settings > Processes, under Connectors - Pull you should see the BigQuery integration and any error.
FAQs
How do BigQuery contacts get linked to Salesforce Accounts?
HG Platform uses the email domain of your provided contacts to link to the website of the respective Salesforce Account.
Troubleshooting
Seeing invalid_rapt errors in Settings > Processes?
This means you're connected via OAuth and your Google Workspace session control policy is expiring the connection. You have two options:
Switch to Service Account auth (Option A above) - permanent fix, no re-authentication ever required.
Have your IT admin exempt the HG Insights app as trusted in Google Workspace (Option B above) - removes the session timeout for this specific app.
Do I need to share Events, Contacts, and Accounts tables?
No. You only need to share the objects required for your use case. A Contacts table is sufficient for contact attributes, an Accounts table is sufficient for account attributes, and Events require both an Events table and a Contacts table.
What columns are required in an Events table?
An Events table must include id, event_name, event_timestamp, contact_id, created_at, and updated_at. Optional event properties may also be included. The contact_id must match the id in the Contacts table.
What columns are required in a Contacts table?
A Contacts table must include id, email, created_at, and updated_at. The id may be the same as the email address. Additional contact properties are optional, and all timestamps must be in UTC.
What columns are required in an Accounts table?
An Accounts table must include id, domain, created_at, and updated_at. Additional account properties are optional, and the timestamps must be in UTC.
Why are created_at and updated_at columns required?
HG Platform uses these columns to pull data incrementally instead of reading the entire table every time. New rows are identified using created_at, while updated rows are identified using updated_at.
Does HG Platform support historical BigQuery data?
HG Platform begins pulling new and updated data after the integration is configured. To import historical data, submit a support ticket specifying the tables and desired start dates. We do not pull more than nine months of event data.