This component enables seamless integration between Edgee and BigQuery, allowing you to collect and forward analytics events to your BigQuery tables.
- Download the latest component version from our releases page.
- Place the
bigquery.wasm
file in your server (e.g.,/var/edgee/components
). - Add the following configuration to your
edgee.toml
:
[[destinations.data_collection]]
id = "bigquery"
file = "/var/edgee/components/bigquery.wasm"
settings.project_id = "your-project-id"
settings.dataset_id = "your-dataset-id"
settings.table_id = "your-table-id"
settings.service_json = "path/to/your/service-account-key.json"
First of all, create a new table with the following schema:
CREATE TABLE `your-project-id.your-dataset-id.your-table-id` (
uuid STRING,
event_type STRING,
timestamp INT64,
timestamp_millis INT64,
timestamp_micros INT64,
consent STRING,
context JSON,
data JSON
);
New records are ingested individually using BigQuery's streaming API. If your BigQuery table supports JSON types, both context
and data
will contain additional JSON sub-fields, whose schema is automatically inferred at runtime.
Please note that:
- The sub-fields under
context
are always the same, so you can use queries such asSELECT context.client.ip AS ip FROM your-project-id.your-dataset-id.your-table-id
. - The sub-fields under
data
depend on the value ofevent_type
, so you can use queries such as:SELECT data.track.name FROM your-project-id.your-dataset-id.your-table-id WHERE event_type = 'track'
SELECT data.page.path FROM your-project-id.your-dataset-id.your-table-id WHERE event_type = 'page'
The component maps Edgee events to BigQuery records as follows.
Edgee Event | BigQuery Record | Description |
---|---|---|
Page | A new record in the configured table | Full JSON dump of the Page event |
Track | A new record in the configured table | Full JSON dump of the Track event |
User | A new record in the configured table | Full JSON dump of the User event |
[[destinations.data_collection]]
id = "bigquery"
file = "/var/edgee/components/bigquery.wasm"
settings.project_id = "your-project-id"
settings.dataset_id = "your-dataset-id"
settings.table_id = "your-table-id"
settings.service_json = "path/to/your/service-account-key.json"
Control which events are forwarded to BigQuery:
settings.edgee_page_event_enabled = true # Enable/disable page view tracking
settings.edgee_track_event_enabled = true # Enable/disable custom event tracking
settings.edgee_user_event_enabled = true # Enable/disable user identification
Prerequisites:
Build command:
edgee component build
Test command:
make test
Interested in contributing? Read our contribution guidelines.
Report security vulnerabilities to security@edgee.cloud.