# Marketing Data Mart

## Overview

The marketing data mart \[`dm_mkt`] is designed to allow merchants to leverage our [Unified Marketing Schema (UMS)](https://help.daasity.com/core-concepts/data-models/unified-schemas/unified-marketing-schema-ums), [Unified Order Schema (UTS)](https://help.daasity.com/core-concepts/data-models/unified-schemas/unified-traffic-schema-uts) and [Channel Attribution Data Mart](https://help.daasity.com/core-concepts/data-models/unified-schemas/data-marts/channel-attribution-data-mart) to understand the marketing performance of different channels and Ad platforms using different attribution methodologies to make better decisions

## Entity Relationship Diagram (ERD)

[Click on this link to view](https://lucid.app/documents/embedded/89eef7a5-ecb4-477f-acaf-a5b7c1f5550a) the ERD for the Marketing Data Mart \[`dm_mkt`] illustrating the different tables and keys to join across tables.

## Tables & Source Code

There are two core tables in the \[`dm_mkt`] schema:

* \[`dm_mkt.fct_assisted_orders`] - this table is a summary table that contains a record for each day, channel, vendor (marketing platform) and store.  It is designed to aggregate all the non-last click touches that drove an order to help better understand marketing performance
* \[`dm_mkt.fct_vendor_level_performance`] - this table is a summary table that contains a record for each day, channel, vendor (marketing platform) and store.  It is designed to combine attributed sales and marketing spend from each of the different attribution types to easily enable a comparison of marketing performance metrics (ROAS, CPO, CPA, etc.).  This table is optimized for reporting and is the source for the Marketing Attribution View

Users with access to our [Code Repository](https://help.daasity.com/technical-docs/transform-code/code-repository) can review our code in the following Github repository:

* [Marketing Data Mart Transformation Code](https://github.com/Daasity/platform-sql-shared/tree/master/scripts/datamart/14_marketing)
