Rebuilding a Scalable Snowflake dbt Data Model for Accurate Transaction & Customer Data Integration

Case Study

About the client

The client is a global consumer packaged goods (CPG) company with a diversified portfolio spanning oral care, personal care, and home care brands, sold across multiple countries. The company partners with a third-party receipt-scanning and rewards platform to capture point-of-sale shopper data, which feeds its customer relationship management, loyalty, and marketing attribution programs.

Data analytics

Use case Overview

  • Rebuilt the Snowflake dbt model to ingest and transform receipt transaction data.
  • Matched products to master data, resolving brand, category, and subcategory attributes.
  • Linked transactions to the correct CRM subscriber identities across the multi-brand ecosystem, ensuring accurate customer attributio
  • Implemented robust validation and deduplication controls to ensure accurate, consistent, and reliable data across all records.

Challenges

  • Incomplete Master Data: Many scanned barcodes lacked product, brand, or category mappings.
  • Unmapped Barcodes: Certain barcode ranges had no master-data entries, requiring alternative classification.
  • Subscriber Fan-Out: Shared emails across brands risked duplicate or cross-brand subscriber matches.
  • Inconsistent Brand Names: Brand naming differences across systems caused matching failures.

Solution

NoCommitments

Tiered Matching Framework

Implemented a prioritized matching sequence — exact barcode match, then a leading-zero-normalized barcode match, then a dedicated fallback for the unmapped barcode range — so the most reliable source always took precedence.

Pocess 02

Custom Attribute Mapping

Built a maintainable brand-to-category/subcategory reference for products with no master-data coverage, combined with description-based rules (toothbrush type, floss, whitening, etc.) to standardize subcategories to the client's controlled vocabulary.

Implimentation

Brand-Aware Subscriber Matching

Redesigned identity resolution to match consumer emails against CRM records using the correct brand code — derived dynamically from the CRM brand reference table rather than hardcoded — with a defined fallback for transactions where no brand-specific match exists, eliminating duplicate and cross-brand subscriber assignments.

Group 65

Deduplication Safeguards

Added explicit dedup logic at every identity and matching join, guaranteeing one clean match per transaction and preventing row multiplication.

Powerful visualizations

Consolidated Model Design

Refactored the transformation from a multi-stage, layered structure into a single-pass query, computing repeated business rules once and reusing them for a model that's easier to read, audit, and maintain.

Services

Impact

  • Improved Category Coverage: Meaningfully reduced the number of unclassified transactions across the client’s non-flagship brands.
  • Accurate Subscriber Attribution: Eliminated duplicate and cross-brand subscriber assignments, giving the client a single, trustworthy identity per transaction.
  • Cleaner, Auditable Data Lineage: The consolidated model design makes it straightforward to trace exactly how each transaction’s category, brand, and subscriber identity were derived — directly supporting downstream analytics and marketing initiatives that were previously limited by incomplete classification.