Skip to main content

Set up the Attribution dbt package

Data modeling
  • Introduction

  • Before you start

  • Enabling Conversions within Unified Package

  • Setting up locally

  • Setting up via Snowplow Console

  • Optional - Configuring Channel Group Classification

  • Optional - Adding Marketing Spend Source for ROAS

Last updated on

Optional - Adding Marketing Spend Source for ROAS

If you have marketing spend source data in your data warehouse then the Snowplow Attribution model package provides a configuration option that allows you to integrate your spend data with the attribution_overview view.

  1. Create a view (or regularly updated table) based on your marketing spend data that has the columns below. Your channel and spend data will be summed separately in the attribution_overview, so you would not need to pre-aggregate this, it is fine to have channel twice for the same period even, but make sure that the data does not include duplicates as it might lead to unexpected outcomes.
Column NameData TypeRequired
spend_tstampTIMESTAMPRequired
channelSTRINGOptional (Channel or Campaign)
campaignSTRINGOptional (Channel or Campaign)
spendNUMERICRequired
  1. Update your dbt_project.yml file to configure the variable to the location of your spend table.
vars:
snowplow_attribution:
snowplow__spend_source: 'your_schema.marketing_spend_source'
  1. Run the dbt package
dbt run
  1. Congratulations, your attribution_overview view within your _derived schema should now reference your marketing spend source to provide a ROAS calculation!
info

Please Note: By default in the attribution_overview view created by the package spend is allocated associated with a channel/campaign for the 90 days prior to the conversion. You can configure this by overriding the macro within dbt.