Marketplace & Ads Analytics

src/marketplace/drive_ads_analytics — internally referred to as UDP in comments and table names, though that codename doesn't appear in the project's own config — is the largest dbt project in this repo, spanning ad platforms, GA4, Insider, and cross-database reads of Manifold and Stock's own marts. It's also the only one of the three dbt projects with a 5-layer architecture instead of 4: sources → staging → intermediate → marts → reporting, with a dedicated reporting layer that Stock and Redbook don't have.

A project-level README exists at src/marketplace/README.md, but it describes an earlier, much smaller version of this project — it omits the reporting layer, the sources/ directory, the CRM and web-analytics domains, and most of the current platforms entirely, and lists "aggregated marts" as explicitly out of scope even though a substantial reporting layer now exists. This section is written from the current codebase, not that README.

The five layers

Staging is organised per platform (one folder per ad platform); intermediate, marts, and reporting are organised by business domain instead — crm, paid_media, web_analytics (reporting adds business, inventory, stock). A Google Ads campaign and a Meta Ads campaign are staged separately but land in the same paid_media intermediate/marts models once normalised — see Ad platforms & SCD2 snapshots for exactly how that normalisation happens.

Materialization follows the same pattern found in Stock and Redbook: staging is consistently view, matching the project default, but intermediate, marts, and reporting all deviate substantially from their own layer defaults — intermediate overrides to table/incremental wherever real aggregation state is needed, marts overrides a large share down to view, and reporting overrides most models up to table. The project-level defaults describe only a fraction of what's actually there.

How often this runs

One task, MARKETPLACE_DBT_RUN_DAILY, runs the entire project once a day:

snippet.hclhcl
"MARKETPLACE_DBT_RUN_DAILY" = {
  database_key     = "PROCESSED_DB"
  schema_key       = "PUBLIC"
  dbt_project_name = "MARKETPLACE_DBT"
  schedule_cron    = "0 20 * * * UTC"  # documented as 7am Sydney
  schedule_type    = "cron"
  started          = var.enable_marketplace_dbt_task
  warehouse_key    = "DRIVE_WH"
}
  • Daily at 20:00 UTC — the Terraform comment calls this "7:00 AM Sydney time," accurate under AEDT (UTC+11). Under AEST (UTC+10, roughly April–October), the same cron fires at 06:00 Sydney instead — the same class of DST-comment drift already seen on the Redbook task.
  • Plain dbt run, no --select — every model in the project runs daily, not per-domain.
  • On DRIVE_WH, not a dedicated warehouse.
  • Enabled in both staging and prod as checked in — unlike Stock's task, which is disabled by default in staging.
  • There's no separate schedule for GA4 or any other domain — one task covers everything.

At a glance

SourcesAd platforms via Integrate.io, GA4 via Snowflake's native connector, Insider in its own database, Manifold and Stock as cross-database reads
StagingOne folder per platform
Intermediate / marts / reportingOrganised by domain (crm, paid_media, web_analytics, plus business/inventory/stock at reporting)
SCD2Native dbt snapshot, strategy: check — campaigns on every ad platform, ad groups/ad sets/ads on most
ScheduleMARKETPLACE_DBT_RUN_DAILY, daily at 20:00 UTC, unfiltered dbt run, DRIVE_WH, enabled in both environments
Test postureseverity: warn dominant, with only a couple of error-severity tests (both on cost non-negativity); store_failures isn't configured anywhere in the project

Start here

  • How does data actually arrive in the raw tables, and who can read it? Raw sources & permissions — the real ingestion mechanism per source, not what the stale source-file comments claim.
  • How does per-platform ad data get normalised, and what's the SCD2 mechanism? Ad platforms & SCD2 snapshots.
  • Where does dealer, subscription, and lead data come from? CRM domain (Salesforce).
  • How does GA4 web traffic connect to specific stock listings? GA4 & web analytics.
  • What do the marts actually contain? Marts.
  • What does BI actually query, and where does reporting break from the medallion flow? Reporting layer.
Esc