Skip to main content
Connect BigQuery tables that hold business or application metrics, such as daily active users, transactions, or warehouse query counts. Costory maps them to cloud billing data so you can track cost per user, split shared infrastructure, or build custom KPIs in Explorer and dashboards.
  1. Share the BigQuery dataset with the Costory service account:
    • costory-<org-slug>@costory-production.iam.gserviceaccount.com
    • Grant BigQuery Data Viewer and BigQuery Metadata Viewer on the dataset. These are the same roles used for GCP billing export.
  2. In Costory, go to Metrics > Import new metrics datasource > BigQuery.
  3. Enter the GCP project ID where you shared the dataset.
  4. Select the tables Costory discovers in that project.
  5. Configure each metric: table, date column, value column, aggregation, gap filling, and optional group-by.
Costory scans the project for tables that contain at least one numeric column and one date column. After the connection syncs, pick the integration in the metric selector when editing a dashboard widget or building a query in Explorer.
This connector imports usage metrics from your BigQuery tables. To import GCP billing data, use GCP Billing Setup. To export Costory dashboard data to your own BigQuery project, see BigQuery Data Exports.

Example table schema

Your table needs a date column and at least one numeric metric column. Optional string columns work as group-by dimensions.
Common metrics to import:
  • Product analytics: daily or monthly active users, sessions, sign-ups
  • Business KPIs: revenue, orders, customers, emails sent
  • Application usage: API calls, background jobs, feature usage counts
  • Data platform activity: query counts, bytes processed, or slot hours per team or project

Table requirements

Metric configuration

Configure metrics from a dashboard widget or in Explorer. In the metric selector, choose your BigQuery integration, then set:

Save a metric for Virtual Dimensions

To use a BigQuery metric in a or shared cost allocation rule, save it as a named metric first:
  1. Go to Metrics > Create Metric.
  2. Name the metric.
  3. Select the BigQuery table, date column, numeric column, aggregation, gap filling, and group-by.
  4. Save the metric, then reference it when you configure the virtual dimension rule.
See Unit Economics for formula examples, or BigQuery cost visibility with dbt for attributing warehouse spend by model or team.
Costory caches BigQuery table schemas for performance. After you add a table or change columns, open Metrics, find your BigQuery integration, click , then Refresh catalog so the new schema appears.

Troubleshooting

Unit Economics

Combine BigQuery metrics with cloud cost in Explorer formulas.

Shared Cost Allocation

Split shared infrastructure costs using BigQuery usage metrics.

Usage Metrics

Browse all supported usage metric sources.

BigQuery and dbt visibility

Attribute BigQuery spend by dbt model, package, or team.
Last modified on July 8, 2026