Skip to main content

Bigquery

This page describes how to set up Bigquery as a destination.

Set up

An example setup for Bigquery is shown below.

src/pages/api/syft.ts
// ...
const destinations = [
{
type: "bigquery",
settings: {
projectId: "xxxx",
dataset: "xxxx"
},
},
];
// ...

Configuration options

NameTypeDescriptionRequiredDefault
projectIdstringYour Google Cloud project IDtrue
datasetstringThe dataset to insert events intotrue
keyFilestringPath to your Google Cloud key filefalse
keyDatastringThe contents of your Google Cloud key filefalse

Data Modeling

Track Calls

Insert

Matched events

type = "track" or type = "screen" or type = "page"

Data Mapping

Destination FieldTypeDescriptionSource Field
_idstringThe unique ID of the track call itself.$.messageId
anonymous_idstringThe anonymous ID of the user.$.anonymousId
user_idstringThe User ID.$.userId
context_ipstringThe IP address of the client. Non-user-related context fields sent with each track call.$.context.ip
context_library_namestringThe Logging library name. Non-user-related context fields sent with each track call.$.context.library.name
context_library_versionstringThe Logging library version. Non-user-related context fields sent with each track call.$.context.library.version
context_page_pathstringThe path of the page on which the event was logged.$.context.page.path
context_page_titlestringThe title of the page on which the event was logged.$.context.page.title
context_page_urlstringThe full url of the page on which the event was logged.$.context.page.url
context_localestringThe browsers locale used when the event was logged.$.context.locale
context_user_agentstringThe browsers user-agent string.$.context.userAgent
eventstringThe slug of the event name, so you can join the tracks table.$.event
namestringThe event name.$.name
received_atdatetimeWhen Syft received the track call.$.receivedAt
sent_atdatetimeWhen a user triggered the track call. This timestamp can also be affected by device clock skew$.sentAt
timestampdatetimeThe UTC-converted timestamp which is set by the Syft library$.timestamp
propertiesobjectJSON representation of the properties for the event.$.properties
contextobjectJSON representation of the context$.context
,
Identify Calls

Insert

Matched events

type = "identify" or type = "group"

Data Mapping

Destination FieldTypeDescriptionSource Field
_idstringThe unique ID of the track call itself.$.messageId
anonymous_idstringThe anonymous ID of the user.$.anonymousId
user_idstringThe User ID.$.userId
context_ipstringThe IP address of the client. Non-user-related context fields sent with each track call.$.context.ip
context_library_namestringThe Logging library name. Non-user-related context fields sent with each track call.$.context.library.name
context_library_versionstringThe Logging library version. Non-user-related context fields sent with each track call.$.context.library.version
context_page_pathstringThe path of the page on which the event was logged.$.context.page.path
context_page_titlestringThe title of the page on which the event was logged.$.context.page.title
context_page_urlstringThe full url of the page on which the event was logged.$.context.page.url
context_localestringThe browsers locale used when the event was logged.$.context.locale
context_user_agentstringThe browsers user-agent string.$.context.userAgent
eventstringThe slug of the event name, so you can join the tracks table.$.event
namestringThe event name.$.name
received_atdatetimeWhen Syft received the track call.$.receivedAt
sent_atdatetimeWhen a user triggered the track call. This timestamp can also be affected by device clock skew$.sentAt
timestampdatetimeThe UTC-converted timestamp which is set by the Syft library$.timestamp
propertiesobjectJSON representation of the properties for the event.$.properties
contextobjectJSON representation of the context$.context