# Configure the Attribution data model
> Configure the Attribution dbt package for marketing attribution analysis with customizable conversion paths and channel groupings.
> Source: https://docs.snowplow.io/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/attribution/
> Documentation index: https://docs.snowplow.io/llms.txt

This page helps you configure the Snowplow Attribution dbt package. You can customize variables, generate configuration code, and set output schemas.

## Package configuration variables (v1.0.0)

This package utilizes a set of variables that are configured to recommended values for optimal performance of the models. Depending on your use case, you might want to override these values by adding to your `dbt_project.yml` file.

> **Note: Variable name prefix**
>
> All variables in Snowplow packages start with `snowplow__` but we have removed these in the below tables for brevity.

### Warehouse and tracker

| Variable | Description | Default |
| --- | --- | --- |
| `conversion_path_source` | The source (schema and table) of the  paths (touchpoints). By default it is the derived `snowplow_unified_views` table. Optionally it may be hardcoded with a string reference instead of a source with a schema.table or database.schema.table format. | `{{ source('derived', 'snowplow_unified_views') }}` |
| `conversions_source` | The source (schema and table) of your conversion events,  likely the conversions table generated by the Unified package. Optionally it may be hardcoded with a string reference instead of a source with a schema.table or database.schema.table format. | `{{ source('derived', 'snowplow_unified_conversions') }}` |
| `dev_target_name` | The [target name](https://docs.getdbt.com/docs/core/connect-data-platform/profiles.yml) of your development environment as defined in your `profiles.yml` file. See the [Manifest Tables](/docs/modeling-your-data/modeling-your-data-with-dbt/package-mechanics/manifest-tables/) section for more details. | `dev` |
| `spend_source` | The source (schema and table) of your marketing spend source. Optional, needed for the ROAS calculation of the snowplow_attribution_overview. Should be changed to a table reference with `spend` by `channel` and/or `campaign` by `spend_tstamp` (which denotes a timestamp field) information. | `not defined` |
| `user_mapping_source` | The source (schema and table) of the user mapping table produced by the unified package. In case the user mapping table is not available, the paths_to_conversion macro needs to be overwritten in the dbt project where the package is referenced. | `{{ source('derived', 'snowplow_unified_user_mapping') }}` |

### Operation and logic

| Variable | Description | Default |
| --- | --- | --- |
| `attribution_start_date` | The date to start processing events from in the package on first run or a full refresh, based on the cv_tstamp (conversion timestamp). | `2023-01-01` |
| `path_lookback_days` | Restricts the model to marketing channels within this many days of the conversion (values of 30, 14 or 7 are recommended). | `30` |
| `path_lookback_steps` | The limit for the number of marketing channels to look at before the conversion. | `0 (unlimited)` |
| `allow_refresh` | Used as the default value to return from the `allow_refresh()` macro. This macro determines whether the manifest tables can be refreshed or not, depending on your environment. See the [Manifest Tables](/docs/modeling-your-data/modeling-your-data-with-dbt/package-mechanics/manifest-tables/) section for more details. | `false` |
| `license_accepted` | Use this field to accept the Snowplow Personal and Academic License or specify that you have a commercial agreement with Snowplow. | `false` |
| `conversion_clause` | A string of sql to filter on certain conversion events. | `cv_value > 0 and ev.user_identifier is not null` |
| `conversion_window_days` | The last complete nth number of days (calculated from the last processed pageview within page_views_source) to dynamically update the conversion_window_start_date and end_date with. Will only apply if both variables are left as an empty string. | `30` |
| `conversion_window_end_date` | The end date in UTC for the window of conversions to include. It is only used for the drop and recompute report tables/views. | `""` |
| `conversion_window_start_date` | The start date in UTC for the window of conversions to include. It is only used for the drop and recompute report tables/views. | `current_date()-31` |

### Entities (contexts), filters, and logs

| Variable | Description | Default |
| --- | --- | --- |
| `attribution_list` | List of attribution types to use for reporting. Can be at least one of: first_touch, last_touch, linear, position_based). | `['first_touch', 'last_touch', 'linear', 'position_based']` |
| `campaigns_to_exclude` | List of campaigns to exclude from analysis (empty to keep all campaigns). | `[ ] (no filter applied)` |
| `campaigns_to_include` | List of campaigns to include in the analysis (empty to keep all campaigns). | `[ ] (no filter applied)` |
| `channels_to_exclude` | List of channels to exclude from analysis (empty to keep all channels). For example, users may want to exclude the `Direct` channel from the analysis. | `[ ] (no filter applied)` |
| `channels_to_include` | List of channels to include in the analysis (empty to keep all channels). For example, users may want to include the `Direct` channel only in the analysis. | `[ ] (no filter applied)` |
| `consider_intrasession_channels` | If `false`, only considers the channel at the start of the session (i.e. first page view). If `true`, considers multiple channels in the conversion session as well as historically. | `true` |
| `conversion_hosts` | `url_hosts` to filter to in the data processing | `[] (no filter applied)` |
| `conversion_stitching` | This should be set to true if both the snowplow__conversion_stitching and snowplow__view_stitching variables are also enabled in the Unified package. If allowed it will consider the stitched_user_id field, not the user_identifier in the source data for more accurate results. | `false` |
| `enable_paths_to_non_conversion` | If `true`, enable the paths_to_non_conversion model, which is a drop and recompute table that may be needed for more in-depth attribution analysis (used in the `path_summary` table as well) | `false` |
| `enable_attribution_overview` | If `true`, enable the attribution_overview model, which is a view that creates a great source for BI tools to use for reporting | `true` |
| `path_transforms` | Dictionary of path transforms (and their argument) to perform on the conversion path (see the transform path options in our [model docs](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-attribution-data-model/)). For `remove_if_not_all` and `remove_if_last_and_not_all` transformations, the argument has to be a non-empty array, for the others it should be null. | `{'exposure_path': null}` |

