RoadwayDocs

Table schemas

When Roadway reads your warehouse, your tables must match these schemas.

The tables

Dataset Reference page What it records
Page views Page views Website visits and the pages people see
Users Users Sign-ups and descriptive attributes
Revenue Revenue Subscriptions or transactions
CRM CRM Contacts, opportunities or deals, and pipeline
Ad spend Ad spend Campaign cost by day
Mobile (MMP) Mobile measurement partners App installs and in-app events

Shared conventions are on Data conventions and Custom dimensions.

Source options

For most datasets you can provide data in one of three ways:

  1. A vendor schema that Roadway understands natively, such as Segment pages and identifies, or GA4 export tables.
  2. A supported ETL connector's schema, such as Airbyte or Fivetran for Stripe, and the connector and platform pairs listed under Ad spend.
  3. A custom table. Roadway maps it in your workspace's model. Matching the schemas in this section makes that mapping simple. Use this when you have existing modeling or an unusual source.

Prefer options 1 and 2 where possible. Roadway transforms them for you.

The IDs each table needs

See Required IDs by table. In short: page views carry visitor_id and user_id, users carry user_id, revenue carries customer_id and user_id, CRM contacts carry contact_id and visitor_id.

Rules that apply everywhere

  • No PII. See Create PII-free views.
  • Timestamps in UTC.
  • Currency in currency units, not cents or micros.
  • Stable IDs. The same entity must keep the same ID over time.

Data conventions

Topic Convention
Timestamps UTC. Use timestamp types, not strings
Dates date type, in UTC, formatted YYYY-MM-DD when a string is unavoidable
IDs varchar. Always the same format and casing for the same entity across tables
Money Currency units (for example dollars), not cents or micros. One reporting currency per table
Refunds Separate negative rows. Don't edit the original row
Nulls Use NULL for missing values, not empty strings or placeholder text such as 'unknown'
Booleans boolean. For custom dimensions, varchar or boolean
Table and column names snake_case. Use the exact names in this section
PII Not allowed in any column
Deduplication Each table must be deduplicated on its primary key

Primary keys

Table Primary key
users user_id
dim__customers customer_id
fact__customer_arr_snapshot (customer_id, subscription_id, date_day)
fact__transactions transaction_id
dim__contacts contact_id
dim__opportunities opportunity_id
fact__pipeline_arr_snapshot (opportunity_id, date_day)
dim__marketing_campaigns (campaign_id, platform_name)

Renames

Roadway treats a renamed partner, campaign, or event as a new value. Tell Roadway before you rename.

Custom dimensions

Extra columns that let you group or filter metrics by your own segments, such as persona, plan type or industry.

Examples

Attribute Type Description Example values
persona varchar User segment enterprise, smb, individual, student
plan_type varchar Plan level free, pro, enterprise, trial
signup_source varchar Primary signup channel organic, paid, referral, direct
industry varchar Industry technology, healthcare, finance
company_size varchar Size bracket 1-10, 11-50, 51-200, 200+

Best practices

  1. Avoid PII. Remove emails, names, and phone numbers by exposing views.
  2. Use categories. Avoid high-cardinality fields such as company name or exact revenue.
  3. Standardize values. Use consistent casing, such as lowercase.
  4. Handle nulls. Metrics must tolerate missing values.
  5. Limit the number of values. Keep each dimension to a few dozen categories, ideally under 20. When you group by a dimension, Roadway shows its 100 most common values and leaves out the rest.

Example queries

-- Good: low-cardinality categorical field
SELECT
  user_id,
  CASE
    WHEN annual_revenue < 1000000  THEN 'smb'
    WHEN annual_revenue < 10000000 THEN 'mid_market'
    ELSE 'enterprise'
  END AS company_size
FROM user_data;
-- Avoid: PII and high-cardinality fields
SELECT
  user_id,
  company_name,   -- too specific, could be PII
  exact_revenue,  -- too many values
  full_email      -- PII
FROM user_data;

Where custom dimensions apply

Table Supported
Users Yes
dim__customers Yes
dim__opportunities Yes
dim__contacts Yes
fact__transactions Yes