{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Machine Learning","type":"markdown"},"seo":{"title":"Multi Touch Attribution","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"multi-touch-attribution","__idx":0},"children":["Multi Touch Attribution"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Multi-touch attribution (MTA) is a method of marketing measurement, determining the value of each customer touchpoint that leads to a conversion."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2023-2-23_20-46-48.b2b70efcffaa0bc42b49ef701ecd1c17072d46cfb615d7eb5561618a1452ebdc.3cb60505.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn more about MTA through this ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://blog.treasuredata.com/blog/2020/02/10/how-does-multi-touch-attribution-work-and-what-convinced-the-customer-to-buy/"},"children":["TD blog post"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"assumed-input","__idx":1},"children":["Assumed Input"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This notebook assumes a user journey table as follow:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tstamp"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["user"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["channel"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["conversion"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1596012307"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yl38g61s2x"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["sfmc"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1596012340"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["d4dbvpwcyj"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["instagram"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1596012427"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["egeaf1po46"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["facebook"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1596012553"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["gls9vyk2de"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["google"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1596012645"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ps6cc25f24"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["instagram"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each row represents a touchpoint with a timestamp (unix time or datetime) of a user."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["tstamp accepts unix time (long) or datetime formats."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["channel is typically a marketing channel such as facebook."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["conversion values are numerical integer/float or boolean values meaning how much conversion value can be obtained through the touchpoint."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use alternative column names by setting notebook parameters."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"expected-outcomes","__idx":2},"children":["Expected Outcomes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Supported Heuristic models are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Last Touch"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Last Touch Non-Direct"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["First Touch"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Linear"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Time Decay"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Position Based (U-shaped/W-shaped)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Supported Algorithmic models are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Shapley Value"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Markov Chains"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can export channel interactions, Shapley attribution for each conversion paths/journey, and/or attributed conversions for each channel as TD tables."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some example visualizations from the MTA Notebook are shown below:"," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2023-2-28_10-28-1.c03de9d077ec82959f9db27bf18b811648e2d9ac46177e9f4bc3aefcbbc53a1e.3cb60505.png","alt":""},"children":[]}," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2023-2-28_10-28-30.93824ad8cf836d55c49e3f5fb1550ed6456c9afbf3694c6181017eb4ab7c35ea.3cb60505.png","alt":""},"children":[]}," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2023-2-28_10-29-39.afcc3b3292f2f04f8701f06bf93fdf69c3859903cd4d8ce3727877748a4b4fe5.3cb60505.png","alt":""},"children":[]}," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2023-2-28_10-30-8.faa0ac16672ce13737afbdcbc0e6d6c78c16ec040c606ec71ceaa614fa8dfbe1.3cb60505.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"workflow-example","__idx":3},"children":["Workflow Example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Find a sample workflow in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/treasure-boxes/blob/automl/machine-learning-box/automl/mta.dig"},"children":["Treasure Boxes"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"+run_mta:\n  ipynb>:\n    notebook: MTA\n    # required param\n    input_table: ml_datasets.mta\n    # optional param\n    tstamp_column: tstamp\n    user_column: user\n    channel_column: channel\n    conversion_column: conversion\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters","__idx":4},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter name"},"children":["Parameter name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter on Console"},"children":["Parameter on Console"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default Value"},"children":["Default Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["docker.task_mem"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Docker Task Mem"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Task memory size. Available values are 64g, 128g (default), 256g, 384g, or 512g depending on your contracted tiers"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["128g"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["input_table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Input Table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["specify a TD table to run MTA as dbname.table_name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["-"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["tstamp_column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tstamp Column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["timestamp column name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["tstamp"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["user_column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User Column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["user column name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["user"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["channel_column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Channel Column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["channel column name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["channel"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["conversion_column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Conversion Column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["conversion column name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["conversion"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ignore_channels"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ignore Channels"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specify a string list of channels to ignore"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["first_touch"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["First Touch"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Position-based modeling parameter to control the first touch importance such as 0.4 (40%)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.4"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["last_touch"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Last Touch"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Position-based modeling parameter to control the last touch importance such as 0.4 (40%)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.4"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["overwrite_channel"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Overwrite Channel"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Parameter for Last touch Non-Direct modeling. Replace touchpoints with specified channel with one of the previous touchpoints"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["decay_over_time"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Decay Over Time"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Time decal modeling parameter to specify percentage that will be lost by time away from the conversion."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.6"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["decey_frequency"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["DecayDecey Frequency"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Time decal modeling parameter to specify a frequency/interval that the decay will happen."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["12"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["shapely_lookback_size"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shapely Lookback Size"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shapley attribute modeling parameter to define a limit of how long a chain of channels is in every journey"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["export_channel_interactions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Export Channel Interactions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Output table name to export channel interactions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["export_shapley_attributions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Export Shapley Attributions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Output table name to export shapley attribution for each conversion paths"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["export_attributed_conversions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Export Attributed Conversions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Output table name to export attributed conversions for each channel"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None"]}]}]}]}]}]},"headings":[{"value":"Multi Touch Attribution","id":"multi-touch-attribution","depth":1},{"value":"Assumed Input","id":"assumed-input","depth":2},{"value":"Expected Outcomes","id":"expected-outcomes","depth":2},{"value":"Workflow Example","id":"workflow-example","depth":2},{"value":"Parameters","id":"parameters","depth":3}],"frontmatter":{"seo":{"title":"Multi Touch Attribution"}},"lastModified":"2025-11-22T02:43:27.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/machine-learning/automl/notebook-solutions/multi-touch-attribution","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}