source_record_id Dimension

Standard cross-source business record identifier for events, used for reconciliation and CAPI deduplication mappings.

source_record_id is a string-valued event dimension representing the source-system business record identifier for an event.

Examples:

  • timx contract events -> contract_number (enrollment) / contract_sequence_id (renewed)
  • Stripe invoice events -> invoice_id
  • Shopify order events -> order_id

Why This Is a Dimension

source_record_id is broadly useful but not universal. Some events do not have a meaningful business record ID (for example: GA4 pageviews, synthetic events).

Because it is not guaranteed on every event, it should not be added as a core required column on nexus_events. The dimensions facet is the correct home.

How It Flows

  1. Source extraction emits EAV rows with dimension_name = 'source_record_id'
  2. Source-level *_event_dimensions models union those rows
  3. nexus_event_dimensions_unioned ingests all enabled source dimensions
  4. nexus_event_dimensions dynamically pivots to a source_record_id column
  5. Output models join nexus_event_dimensions on event_id (1:1 join)

CAPI Mapping Convention

Use source_record_id for destination-native deduplication fields:

  • Facebook CAPI -> event_id
  • Google Ads Enhanced Conversions -> order_id

Retain the internal Nexus ID separately (for example nexus_event_id) for QA, debugging, and reconciliation.

Timx Example (Extraction)

SELECT
    {{ nexus.create_nexus_id('event_dimension', ['event_id', "'source_record_id'"]) }} as event_dimension_id,
    event_id,
    'source_record_id' as dimension_name,
    CASE
        WHEN event_name = 'enrollment' THEN contract_number
        ELSE contract_sequence_id::VARCHAR
    END as dimension_value,
    occurred_at,
    source
FROM {{ ref('timx_contract_events') }}
WHERE dimension_value IS NOT NULL