You maintain the marketing-analytics dbt project for a direct-to-consumer brand. The growth team splits its budget using the channel_attribution mart, which credits each order's revenue to the marketing channel that brought the customer in. This month's report is unusable. It shows just two orders worth $280: one $200 order credited to affiliate and one $80 order credited to other. The store took six orders worth $810 in March. Email and paid search, the two biggest budget lines, get no credit at all. The partnerships team is also confused, because their only click this month came the morning after the order it is being credited with.
The project is a four-layer DAG. Four raw seeds (raw_pageviews, raw_identifies, raw_orders, raw_channel_map) feed four staging models. int_pageviews_stitched ties each device's pageviews to a user and tags them with a channel, int_sessions groups pageviews into sessions, and int_order_attribution picks the touch that gets credit for each order. The channel_attribution mart rolls revenue up by channel. Each model's header comment documents its contract, and models/schema.yml describes each model's grain.