# Multi Touch Attribution Multi-touch attribution (MTA) is a method of marketing measurement, determining the value of each customer touchpoint that leads to a conversion. MTA helps marketers to figure out which marketing channels or campaigns should be credited with the conversion. Marketers can optimize marketing channels using this notebook. ![](/assets/image2023-2-23_20-46-48.b2b70efcffaa0bc42b49ef701ecd1c17072d46cfb615d7eb5561618a1452ebdc.3cb60505.png) Learn more about MTA through this [TD blog post](https://blog.treasuredata.com/blog/2020/02/10/how-does-multi-touch-attribution-work-and-what-convinced-the-customer-to-buy/). ## Assumed Input This notebook assumes a user journey table as follow: | **tstamp** | **user** | **channel** | **conversion** | | --- | --- | --- | --- | | 1596012307 | yl38g61s2x | sfmc | 0 | | 1596012340 | d4dbvpwcyj | instagram | 0 | | 1596012427 | egeaf1po46 | facebook | 0 | | 1596012553 | gls9vyk2de | google | 1 | | 1596012645 | ps6cc25f24 | instagram | 0 | | ... | ... | ... | ... | Each row represents a touchpoint with a timestamp (unix time or datetime) of a user. * tstamp accepts unix time (long) or datetime formats. * channel is typically a marketing channel such as facebook. * conversion values are numerical integer/float or boolean values meaning how much conversion value can be obtained through the touchpoint. You can use alternative column names by setting notebook parameters. ## Expected Outcomes The outcome of the MTA notebook is an exploration of touchpoints, and the calculation of attributions of each (marketing) channel via various Attribution Models, both Heuristic models and Algorithmic models. Supported Heuristic models are: * Last Touch * Last Touch Non-Direct * First Touch * Linear * Time Decay * Position Based (U-shaped/W-shaped) Supported Algorithmic models are: * Shapley Value * Markov Chains You can export channel interactions, Shapley attribution for each conversion paths/journey, and/or attributed conversions for each channel as TD tables. Some example visualizations from the MTA Notebook are shown below: ![](/assets/image2023-2-28_10-28-1.c03de9d077ec82959f9db27bf18b811648e2d9ac46177e9f4bc3aefcbbc53a1e.3cb60505.png) ![](/assets/image2023-2-28_10-28-30.93824ad8cf836d55c49e3f5fb1550ed6456c9afbf3694c6181017eb4ab7c35ea.3cb60505.png) ![](/assets/image2023-2-28_10-29-39.afcc3b3292f2f04f8701f06bf93fdf69c3859903cd4d8ce3727877748a4b4fe5.3cb60505.png) ![](/assets/image2023-2-28_10-30-8.faa0ac16672ce13737afbdcbc0e6d6c78c16ec040c606ec71ceaa614fa8dfbe1.3cb60505.png) ## Workflow Example Find a sample workflow in [Treasure Boxes](https://github.com/treasure-data/treasure-boxes/blob/automl/machine-learning-box/automl/mta.dig). ```yaml +run_mta: ipynb>: notebook: MTA # required param input_table: ml_datasets.mta # optional param tstamp_column: tstamp user_column: user channel_column: channel conversion_column: conversion ``` ### Parameters | Parameter name | Parameter on Console | Description | Default Value | | --- | --- | --- | --- | | docker.task_mem | Docker Task Mem | Task memory size. Available values are 64g, 128g (default), 256g, 384g, or 512g depending on your contracted tiers | 128g | | input_table | Input Table | specify a TD table to run MTA as dbname.table_name | - | | tstamp_column | Tstamp Column | timestamp column name | tstamp | | user_column | User Column | user column name | user | | channel_column | Channel Column | channel column name | channel | | conversion_column | Conversion Column | conversion column name | conversion | | ignore_channels | Ignore Channels | Specify a string list of channels to ignore | None | | first_touch | First Touch | Position-based modeling parameter to control the first touch importance such as 0.4 (40%) | 0.4 | | last_touch | Last Touch | Position-based modeling parameter to control the last touch importance such as 0.4 (40%) | 0.4 | | overwrite_channel | Overwrite Channel | Parameter for Last touch Non-Direct modeling. Replace touchpoints with specified channel with one of the previous touchpoints | None | | decay_over_time | Decay Over Time | Time decal modeling parameter to specify percentage that will be lost by time away from the conversion. | 0.6 | | decey_frequency | DecayDecey Frequency | Time decal modeling parameter to specify a frequency/interval that the decay will happen. | 12 | | shapely_lookback_size | Shapely Lookback Size | Shapley attribute modeling parameter to define a limit of how long a chain of channels is in every journey | 4 | | export_channel_interactions | Export Channel Interactions | Output table name to export channel interactions | None | | export_shapley_attributions | Export Shapley Attributions | Output table name to export shapley attribution for each conversion paths | None | | export_attributed_conversions | Export Attributed Conversions | Output table name to export attributed conversions for each channel | None |