> For the complete documentation index, see [llms.txt](https://help.daasity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.daasity.com/technical-docs/transform-code/transform-code/unified-marketing-schema-ums-code.md).

# Unified Marketing Schema (UMS) Code

This page provides information on the transform code block that is needed to populate the Unified Marketing Schema (UMS) and what should be added to a Script Manifest file in order to execute the code

## Workflows <a href="#script-manifest-file-yml" id="script-manifest-file-yml"></a>

### Upstream Data Mart Dependencies

{% hint style="success" %}
There are no Data Marts that need to be updated prior to UOS
{% endhint %}

The proper sequence of either a Workflow or position in a Script Manifest file to populate this Data Mart is highlighted in the [Transform Code Sequence - Data Mart](/technical-docs/transform-code/transform-code/transform-code-sequence-data-mart.md) page

## Script Manifest File (YML) <a href="#script-manifest-file-yml" id="script-manifest-file-yml"></a>

### Transformation Code Requirements

Transformation code should be added to the UOS block below depending on the integration.  Instructions on what code to add for each integration is available in the following sections:

* [Amazon Ads](/core-concepts/data-integrations/setup-guides/digital-integrations/amazon-advertising.md)
* [Criteo](/core-concepts/data-integrations/setup-guides/digital-integrations/criteo.md)
* [Facebook Ads](/core-concepts/data-integrations/setup-guides/digital-integrations/facebook-ads.md)
* [Google Ads](/core-concepts/data-integrations/setup-guides/digital-integrations/google-ads.md)
* [Pepperjam](broken://pages/hwNFVy9YySZe2XSUWkkD)
* [Pinterest](/core-concepts/data-integrations/setup-guides/digital-integrations/pinterest.md)
* [Snapchat](/core-concepts/data-integrations/setup-guides/digital-integrations/snapchat.md)
* [Tiktok](broken://pages/avJ2wvYRCLy3aGGZp9XB)
* [Twitter](broken://pages/UJJnSf1JLfpeb0Je1nJo)

The following code should also be added to the UMS block to make sure that all the Brand Supplied Data is included in UMS and additional updates to UMS are made

```
  #--------------------------------------------------------------------------------------------------------------------
  # SECTION: 1500_UMS
  # DEPENDENCIES: Marketing Integrations
  # OPTIONAL:
  #   - Integration: Amazon Ads
  #   - Integration: Criteo
  #   - Integration: Facebook
  #   - Integration: Google Adwords
  #   - Integration: Pepperjam
  #   - Integration: Pinterest
  #   - Integration: Rockerbox
  #   - Integration: Snapchat
  #   - Integration: Tiktok
  #   - Integration: Twitter
  # REQUIRED: No
  # PURPOSE: These SQL scripts transform data from the source schema into the UMS schema.  The code should be enabled
  # when the integration has been added
  #--------------------------------------------------------------------------------------------------------------------
  ums:
    integrations:
    scripts:
      - "github://platform-sql-shared/scripts/base/1500_ums/1510_UMS_BAS_initialize_spend.sql"
      - "github://platform-sql-shared/scripts/base/1500_ums/vendor_kpi/2510_UMS_BAS_initialize_vendor_performance.sq
      
  # INTEGRATION CODE GOES HERE
  
    ums_final:
    # - this block always needs to be at the end after the different integrations
    integrations:
    scripts:
      - "github://platform-sql-shared/scripts/pro/1500_ums/1580_UMS_BAS_mktg_spend_source.sql"
      - "github://platform-sql-shared/scripts/pro/1500_ums/1900_UMS_BAS_master_spend.sql"
```

### Unified Marketing Schema

{% hint style="success" %}
Add this code to populate all of the UMS tables and include data from the Brand Supplied Data section of the Daasity App
{% endhint %}

#### UMS

Add this code to initialize the marketing spend from the BSD and the Vendor KPI tables

* <https://github.com/Daasity/platform-sql-shared/blob/master/scripts/base/1500_ums/1510_UMS_BAS_initialize_spend.sql>
* <https://github.com/Daasity/platform-sql-shared/blob/master/scripts/base/1500_ums/vendor_kpi/2510_UMS_BAS_initialize_vendor_performance.sql>

#### UMS Final

Add this code to complete the UMS transformation

* <https://github.com/Daasity/platform-sql-shared/blob/master/scripts/pro/1500_ums/1580_UMS_BAS_mktg_spend_source.sql>
* <https://github.com/Daasity/platform-sql-shared/blob/master/scripts/pro/1500_ums/1900_UMS_BAS_master_spend.sql>
