Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/readme edits #36

Merged
merged 9 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ target-path: "target"
clean-targets: ["target", "dbt_modules", "dbt_packages"]
macro-paths: ["macros"]
log-path: "logs"

models:
tasman_dbt_mta:
+schema: tasman_mta
32 changes: 16 additions & 16 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@ vars:
snowflake_dev_warehouse: ""
```

- `incremental`: "true" or "false" depending on whether the model should run using incremental models or not
- `touches_model`: Reference to the model containing touch data points. This can be touches or sessions - [read more here](#touches-vs-sessions).
- `touches_timestamp_field`: Field within the `touches_model` that contains timestamps for each touch point.
- **`incremental`:** "true" or "false" depending on whether the model should run using incremental models or not
- **`touches_model`:** Reference to the model containing touch data points. This can be touches or sessions - [read more here](#touches-vs-sessions).
- **`touches_timestamp_field`:** Field within the `touches_model` that contains timestamps for each touch point.
- Touches must occur in the past, and there are column tests throughout the package to validate this.
- `touches_event_id_field`: Field within the `touches_model` that contains a unique indentifier for each touch point
- `touches_user_id_field`: Field within the `touches_model` that contains the user identifier
- `conversions_model`: Reference to the model containing conversion data points
- `conversions_timestamp_field`: Field within the `conversions_model` that contains timestamps for each conversion.
- **`touches_event_id_field`:** Field within the `touches_model` that contains a unique indentifier for each touch point
- **`touches_user_id_field`:** Field within the `touches_model` that contains the user identifier
- **`conversions_model`:** Reference to the model containing conversion data points
- **`conversions_timestamp_field`:** Field within the `conversions_model` that contains timestamps for each conversion.
- Conversions must occur in the past, and there are column tests throughout the package to validate this.
- `conversions_event_id_field`: Field within the `conversions_model` that contains a unique indentifier for each conversion
- `conversions_user_id_field`: Field within the `conversions_model` that contains the user identifier
- `conversion_rules`: A seed file containing rules that can be used to filter specific conversions for each attribution model
- `touch_rules`: A seed file containing rules that can be used to filter specific touches for each attribution model
- `attribution_rules`: A seed file containing rules that are used to determine how touches are attributed to conversions (specs) for each attribution model
- `conversion_shares`: A seed file that maps to each attribution spec to determine the credit awarded to touches meeting each rule for each attribution model
- `attribution_windows`: A seed file that determines the maximum time between a touch and its conversion for each attribution model
- `snowflake_prod_warehouse`: **(Snowflake connections only)** This is the snowflake warehouse that should be used for when the target = 'prod'. An empty string will use the profile default warehouse.
- `snowflake_dev_warehouse`: **(Snowflake connections only)** This is the snowflake warehouse that should be used for when the target = 'dev'. An empty string will use the profile default warehouse.
- **`conversions_event_id_field`:** Field within the `conversions_model` that contains a unique indentifier for each conversion
- **`conversions_user_id_field`:** Field within the `conversions_model` that contains the user identifier
- **`conversion_rules`:** A seed file containing rules that can be used to filter specific conversions for each attribution model
- **`touch_rules`:** A seed file containing rules that can be used to filter specific touches for each attribution model
- **`attribution_rules`:** A seed file containing rules that are used to determine how touches are attributed to conversions (specs) for each attribution model
- **`conversion_shares`:** A seed file that maps to each attribution spec to determine the credit awarded to touches meeting each rule for each attribution model
- **`attribution_windows`:** A seed file that determines the maximum time between a touch and its conversion for each attribution model
- **`snowflake_prod_warehouse`:** **(Snowflake connections only)** This is the snowflake warehouse that should be used for when the target = 'prod'. An empty string will use the profile default warehouse.
- **`snowflake_dev_warehouse`:** **(Snowflake connections only)** This is the snowflake warehouse that should be used for when the target = 'dev'. An empty string will use the profile default warehouse.


# Configuring the Models
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/.sqlfluff
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ max_line_length = 500

[sqlfluff:templater:dbt]
project_dir = ./
profile = tasman_dbt_mta_integration_tests
profile = tasman_integration_tests

[sqlfluff:templater:jinja]
apply_dbt_builtins = True
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/macros/generate_schema_name.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% macro generate_schema_name(custom_schema_name, node) -%}
{{ generate_schema_name_for_env(custom_schema_name, node) }}
{%- endmacro %}
1 change: 0 additions & 1 deletion models/tasman_mta__attributed_conversions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{{
config(
materialized='table',
schema='attribution',
snowflake_warehouse=get_warehouse()
)
}}
Expand Down
1 change: 0 additions & 1 deletion models/tasman_mta__attributed_touches.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{{
config(
materialized='table',
schema='attribution',
snowflake_warehouse=get_warehouse()
)
}}
Expand Down
14 changes: 12 additions & 2 deletions models/tasman_mta__filtered_conversion_events.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{% if var('incremental') == 'true' %}
{{config(materialized='incremental', schema='attribution', snowflake_warehouse=get_warehouse())}}
{{
config(
materialized='incremental',
snowflake_warehouse=get_warehouse()
)
}}
{% else %}
{{config(materialized='table', schema='attribution', snowflake_warehouse=get_warehouse())}}
{{
config(
materialized='table',
snowflake_warehouse=get_warehouse()
)
}}
{% endif %}

with
Expand Down
4 changes: 2 additions & 2 deletions models/tasman_mta__filtered_touch_events.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if var('incremental') == 'true' %}
{{config(materialized='incremental', schema='attribution', snowflake_warehouse=get_warehouse())}}
{{config(materialized='incremental', snowflake_warehouse=get_warehouse())}}
{% else %}
{{config(materialized='table', schema='attribution', snowflake_warehouse=get_warehouse())}}
{{config(materialized='table', snowflake_warehouse=get_warehouse())}}
{% endif %}

with
Expand Down
1 change: 0 additions & 1 deletion models/tasman_mta__performance_history.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{{
config(
materialized='incremental',
schema='attribution',
on_schema_change="sync_all_columns",
snowflake_warehouse=get_warehouse(),
full_refresh=false
Expand Down
14 changes: 8 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
</picture>
</a>

> We are the boutique analytics consultancy that turns disorganised data into real business value.
>We are the boutique analytics consultancy that turns disorganised data into real business value. [Get in touch](https://tasman.ai/contact/) to learn more about how Tasman can help solve your organisations data challenges.

# Multi-Touch Attribution Engine

**Key Features:**
- 🔩 Boolean-algebra based filter definitions, allowing fine control of the touches and conversions that are analysed for each attribution model without editing any SQL.
- 🪛 Reconfigurable positional and time-based attribution models.
- 🔀 Multiple concurrent models, enabling robust multi-model analyses.
- ⏰ Fine-grain attribution window control.
- 🔩 Boolean-algebra rule-based configurations avoiding custom SQL requirements
- 🪛 Reconfigurable positional and time-based attribution models
- 🔀 Multiple concurrent models, enabling robust, flexible, multi-model analyses
- ⏰ Fine-grain attribution window control
- ➕ Optional incremental materialisations
- ❄️ Custom warehouse selection (Snowflake only)

Expand All @@ -25,6 +25,8 @@ Multi-touch attribution is a method of marketing measurement that accounts for a

The core functionality of an attribution engine is its ability to match touches to conversions based on a series of rules, known as 'attribution models'.

Multi-touch attribution can be cross-device, however with the increased privacy constraints introduced by Apple in iOS 14.5 and more generally across the industry, deterministic methods of attribution such as those in this engine are generally ineffective for mobile. For mobile attribution, we recommend checking Mobile Measurement Partners (MMPs) with support for Apple's SKAdNetwork such as [Appsflyer](https://www.appsflyer.com/) or [Adjust](https://www.adjust.com/).

>Examples of attribution models that can be configured with this engine include:
>- Last touch - 100% conversion credit is applied to the touch point immediately before the conversion event
>- First touch - 100% conversion credit is applied to the earliest occuring touch point
Expand All @@ -44,7 +46,7 @@ The engine has two primary output models, attributed touches and attributed conv

## Performance Tracking 🚀

Attribution is tricky and it'ss unlikely that optimal results will be achieved during the initial implementation of this engine - this is because the quality of the outputs are entirely dependent on the quality of the inputs along with tuning of the configurations. As such, an [`performance_history`](models/tasman_mta__performance_history.sql) model has been added that will keep track of each time the attribution engine is run, and collect useful statistics that can help accelerate the implementation as well as monitor key metrics such as attribution rate.
Attribution is tricky and it's unlikely that optimal results will be achieved during the initial implementation of this engine - this is because the quality of the outputs are entirely dependent on the quality of the inputs along with tuning of the configurations. As such, a [`performance_history`](models/tasman_mta__performance_history.sql) model has been added that will keep track of each time the attribution engine is run, and collect useful statistics that can help accelerate the implementation as well as monitor key metrics such as attribution rate.

## Current Limitations ⚠️

Expand Down