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

Add attribution app #817

Merged
merged 13 commits into from
May 10, 2024
86 changes: 86 additions & 0 deletions docs/data-apps/attribution-modeling/index.md
agnessnowplow marked this conversation as resolved.
Show resolved Hide resolved
agnessnowplow marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
title: "Attribution Modeling"
sidebar_position: 3
sidebar_label: "Attribution Modeling"
---

:::caution

This data app is currently in Private Preview and features may change without notice.

:::

In today's increasingly complex digital world, users often take multi-channel journeys before converting. Assigning credit across multiple touchpoints is vital to getting an accurate picture of the efficacy of your marketing channels, yet requires merging disparate datasets and running complex calculations.

Our **Attribution modeling** app (together with the [Snowplow Attribution dbt package](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-attribution-data-model/index.md)) lowers the barrier to entry for your marketing team through the following features:

- Incremental SQL model in your warehouse for cost-effective computation
- Choice of first-touch, last-touch, linear and positional methods, with additional filters and transforms available
- Reports for conversions, revenue, spend and Return On Advertising Spend (ROAS) per channel and campaign
- Option to specify your own touchpoint and advertising spend tables
- Intermediate tables that you can build your own attribution models on top of
rlh1994 marked this conversation as resolved.
Show resolved Hide resolved


## Requirements

- [Campaign Attribution enrichment](/docs/enriching-your-data/available-enrichments/campaign-attribution-enrichment/index.md) enabled
- [Referrer Parser enrichment](/docs/enriching-your-data/available-enrichments/referrer-parser-enrichment/index.md) enabled
- Running the [Snowplow Unified Digital dbt Package](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/index.md) with `conversion event(s)` defined and the optional conversion module enabled
- Running the [Snowplow Attribution dbt Package](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-attribution-data-model/index.md)
- Access to the derived tables granted to the role used when setting up the data app

## Preparing Views for the Dashboards

Note that all these settings are global for all users, meaning if you change them they will be changed for everyone. The first user of the app will have to define at least one `View` which is the dataset needed to generate the charts. Defining a View can be done on the `Settings` page.

### 1. Basic Configurations

#### 1.1 Decide on the Update Method

Use the toggle `Last N days View (Dynamic)` to choose whether your would like to define a dynamic view that auto-updates or a static view:

**Defining a Last N Days (Dynamic) View**

The so-called `Dynamic` views are to be used for generating datasets that have a rolling conversion window of last nth day and will be refreshed automatically (e.g. Last 30 days). The app will save the last-refreshed date with the View configurations and any subsequent day a user logs back in the app, a query will run in the background to look for any newly processed conversion event in the conversion source and if there is, the dynamic datasets are refreshed by running all the queries that are needed to generate data for the charts to populate. Once the update finishes the conversion window should display the new date range.

If you choose this option, set the `auto-update days`: the number of days since the last conversion event defined here will define the conversion window.

**Defining a Custom Date Range (static) View**

Non-dynamic views will have to be given a name and will typically be used to generate a fixed dataset (e.g. Jan, Q1, 2023) to avoid having to recalculate the analysis for subsequent users.

Define a fixed conversion window by selecting the appropriate date range with the date picker tool (which gets activated by clicking on the default date range).

#### 1.2 Set a `currency symbol` (defaults to £)

#### 1.3 Decide if you would like to `use Non-Conversions`:

Use this with caution, currently it uses the `snowplow_attribution_paths_to_non_conversion` table as is without considering the conversion period. The intention is to make this a fully automated feature in the near future so watch for updates on this.


### 2. Connect your Data Sources:

1. Select your schema that contains the derived unified and attribution tables: this will trigger an update which checks for any tables with the names closest to what the app expects.
2. After waiting for the update to take place you can revise if the auto-detected source tables are in line with your expectations, you can change them to any other existing tables you have in case they are not correct.
3. Overwrite the attribution_manifest table. Most likely the schema name will have to be modified. Please keep the `schema_name.table_name` notation here. Make sure you press enter once modified.
4. (Optional but recommended) Specify the Spend Source: this will most likely be a view you created on top of your table that holds your marketing spend data. The view should make sure you align the expected field names. It should have `campaign`, `channel`, `spend` and `spend_tstamp` for the analysis to work. Doing this will make sure you have Return On Advertising Spend (ROAS) calculation in your overview. Make sure you press enter once modified.

Once happy with all the imputs press `Create View` button. It will first run a validation against the data sources making sure it has all the fields it needs. After that it will run the queries that generate the data necessary to populate the dashboards. They will be saved as csv files that app will read from when selecting the View on the sidebar.


## Using the Dashboard

Once the Data Analyst or Engineer that knows how to set up the view configured one, users that are only interested in the Dashboard can just use the Attribution Dashboard to review the results of the analysis. There are various filters that make this interactive. Because the data is already saved users can make any of these interactive changes without affecting the warehouse to avoid expensive queries or laggy information retrieval.

### Sidebar filters

Filters on the sidebar refer to all of the dashboard tabs so you only have to change them once. The only exception to this is the Attribution Type, where

- select which `View` to use
- toggle between using `Campaign` or `Channel`
- select which Attribution Type to use (`Fist Touch`, `Last Touch`, `Linear` or `Position Based`)

### Dashboard specific filters

- `Remove paths with only 1 touchpoint`: this exclude paths with only one touch point to make it more useful in certain scenarios
- `Top N Filter`: filter your charts according to the top nth value
3 changes: 1 addition & 2 deletions docs/data-apps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ Note that some data is processed further after the query to get in the format re
Our apps provide useful help text throughout the apps, keep an eye out for the help icon (<Icon icon="fa-regular fa-circle-question"/>) to provide more context or help in using some functionality.

### Log Out
If you wish to Log out of the application, you can do this on the `Account` page of any application. Note this also logs you out of Console.

If you wish to Log out of the application, you can do this from the sidebar. Note this also logs you out of Console.

## One off-setup
To setup the app and have it connect to your warehouse we require a user/role to run the app via, the below steps provide more information on this.
Expand Down
14 changes: 9 additions & 5 deletions docs/data-apps/marketing-dashboards/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ sidebar_label: "User & Marketing Analytics"

:::caution

This data app is currently in Public Preview and features may changes without notice.
This data app is currently in Public Preview and features may change without notice.

:::

The User & Marketing Analytics app contains all the visuals you need to perform a high level analysis of your web and mobile performance. This includes:
The **User & Marketing Analytics** app contains all the visuals you need to perform a high level analysis of your web and mobile performance. This includes:
- Reports on user acquisition
- Information relating to your traffic sources
- Insight into user retention
Expand All @@ -20,12 +20,16 @@ The User & Marketing Analytics app contains all the visuals you need to perform
## Requirements

- [YAUAA enrichment](/docs/enriching-your-data/available-enrichments/yauaa-enrichment/index.md) enabled
- [Campaign Attribution enrichment](/docs/enriching-your-data/available-enrichments/campaign-attribution-enrichment/index.md) enabled
- [IP Lookup enrichment](/docs/enriching-your-data/available-enrichments/ip-lookup-enrichment/index.md) enabled
- [Referrer Parser enrichment](/docs/enriching-your-data/available-enrichments/referrer-parser-enrichment/index.md) enabled

- One of:
- (**Recommended**) Running the [Snowplow Unified Data Model](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/index.md) with:
- (**Recommended**) Running the [Snowplow Unified dbt Package](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/index.md) with:
- `snowplow__enable_yauaa` set to `true`
- `snowplow__list_event_counts` set to `true`
- (optional) Conversion event(s) defined, with `snowplow__total_all_conversions` set to `true`
- Running the [Snowplow Web Model](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/index.md) with:
- Running the [Snowplow Web dbt Package](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/index.md) with:
- `snowplow__enable_yauaa` set to `true`
- `snowplow__list_event_counts` set to `true`
- (optional) Conversion event(s) defined, with `snowplow__total_all_conversions` set to `true`
Expand All @@ -44,7 +48,7 @@ Some charts in the app are only related to new or returning users, not both, so
### Settings
:::tip

All configurations can be found in the Setup page. Note that all these settings are global for all users, meaning if you change them they will be changed for everyone.
All configurations can be found in the `Settings` page. Note that all these settings are global for all users, meaning if you change them they will be changed for everyone.

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ The purpose of this package is to allow an incremental, efficient way to do mark

In the below guide we will walk you through the data transformation process step-by-step in order for you to see how the source data changes downstream. This will give you and your team a transparent and easy-to-understand way to see how this package will lead you to valuable insights.

We also provide the **[Attribution Data App](/docs/data-apps/attribution-modeling/index.md)** specifically to help your analysis by visualizing the output in the form of interactive dashboards as well as letting you capture datasets for comparison. It works in tandem with the package and will auto-update daily in case your package has been processed since then.

## Sources you are going to need

### 1. Conversion source
Expand Down Expand Up @@ -267,6 +269,7 @@ import AttributionDbtMacros from "@site/docs/reusable/attribution-dbt-macros/_in
| channel | first_touch | Display_Other | 1 | 1 | 2023-07-19 04:27:51.000 | 2023-07-19 04:27:51.000 | 100,000 | 66.5 | 66.5 | 0.000665 |
| channel | first_touch | Organic_Search | 2 | 0| 2023-07-19 04:27:51.000 | 2023-07-25 07:52:34.000 | 100,000 | 206.5 | 0 | 0 |


### Manifest table

We have included a manifest table to log information about the setup variables each time the **`paths_to_conversion`** incremental table runs to help prevent and debug issues.