[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eThe Markov chain statistical function probabilistically assigns credit to advertising touchpoints based on their contribution to user conversions.\u003c/p\u003e\n"],["\u003cp\u003eIt uses advertising data to create a Markov chain model, calculating touchpoint contribution by removing it and assessing the change in conversion probability.\u003c/p\u003e\n"],["\u003cp\u003eTouchpoints need at least 50 converting and 50 non-converting users, with outlier users potentially filtered for privacy.\u003c/p\u003e\n"],["\u003cp\u003eTo use this function, create touchpoint and user credit tables and then call the \u003ccode\u003eADH.TOUCHPOINT_ANALYSIS\u003c/code\u003e table-valued function.\u003c/p\u003e\n"],["\u003cp\u003eThe output table provides a Markov chain score for each touchpoint, indicating its modeled contribution to conversions.\u003c/p\u003e\n"]]],["The Markov chain model uses advertising data to calculate touchpoint contribution to conversions. It creates a graph where touchpoints are vertices, and edges represent transition probabilities. Touchpoint contributions are determined by removing each from the graph and recalculating the conversion probability. The function requires two tables: a `touchpoint_temp_table` (user events) and a `user_credit_temp_table` (conversion events), which are input into the `ADH.TOUCHPOINT_ANALYSIS` table-valued function, which outputs a table with touchpoints and their associated Markov chain scores.\n"],null,["# Markov chain analysis\n\nThe Markov chain statistical function uses probabilistic methods to assign credit across advertising touchpoints based on their modeled contribution to a user's likelihood to convert. The output of this experimental function may be useful in assigning credit to a given advertising channel, campaign, or other touchpoint, based on their modeled contribution to conversion events\n\nHow it works\n------------\n\nThe Markov chain statistical function uses your advertising data to create a Markov chain, where each vertex in the ordered graph represents a touchpoint and each edge gives the probability of moving to that next touchpoint, conditional on being at that current touchpoint. It assumes that only the current touchpoint affects the transition probability. The contribution of each touchpoint is then computed by removing the touchpoint from the graph, and calculating the modeled probability of a conversion now that the touchpoint is removed.\n| **Note:** The Markov chain model can only be used with Data Transfer-based tables: `cm_dt_*`, `dv360_dt_*`.\n\nPrivacy restrictions\n--------------------\n\nTouchpoints must include 50 or more converting users and 50 or more non-converting users to not be removed by privacy filters. Additionally, outlier users that contribute a disproportionate amount of credit to a touchpoint may be filtered. Thus, the output from the Markov chain model may be missing some touchpoints that are in the input touchpoints table.\n\n\u003cbr /\u003e\n\nPrivacy messages are shown after each iteration of the Markov chain model. These messages include information on users and touchpoints that were filtered.\n\nOverview of computing Markov chain values\n-----------------------------------------\n\n1. Create the touchpoint and credit tables:\n 1. `touchpoint_temp_table`.\n 2. `user_credit_temp_table`.\n2. Call the `ADH.TOUCHPOINT_ANALYSIS` table-valued function using the temp tables above as arguments.\n\nCreate the touchpoint and credit tables\n---------------------------------------\n\n### Create the touchpoint table\n\nThe touchpoint table is where user events related to touchpoints are defined. Example data may include, but isn't limited to: `campaign_id` , `creative_id`, `placement_id`, or `site_id`.\n| **Note:** Markov chain analysis is currently limited to maximum of 150 touchpoints.\n\nThe table must contain the following columns:\n\n| Column name | Type |\n|--------------|-------------------------------------------------------------------------------|\n| `touchpoint` | `string` Arbitrary touchpoint name. (Must not be NULL or contain commas.) |\n| `user_id` | `string` The id of a user who visits the touchpoint. (Must not be NULL or 0.) |\n| `event_time` | `int` The time that the user visited the touchpoint. (Must not be NULL.) |\n\n| **Caution:** The query will fail if the total number of distinct touchpoints is greater than 150, or if a `user_id` isn't present in the `user_credit_temp_table`.\n\nSample code for creating the table: \n\n CREATE TABLE touchpoint_temp_table\n AS (\n SELECT user_id, event.event_time, CAST(event.site_id AS STRING) AS touchpoint\n FROM adh.cm_dt_impressions\n WHERE\n event.event_type IN ('VIEW')\n AND user_id \u003c\u003e '0'\n AND event.campaign_id IN UNNEST(@campaign_ids)\n\n UNION ALL\n\n SELECT\n user_id, event.event_time, CAST(event.site_id AS STRING) AS touchpoint\n FROM adh.cm_dt_clicks\n WHERE\n event.event_type IN ('CLICK')\n AND user_id \u003c\u003e '0'\n AND event.campaign_id IN UNNEST(@campaign_ids)\n );\n\n### Create the user credit table\n\nThe user credit table is where conversion events are defined.\n\nEvents that follow conversions are considered non-conversion events.\n\n\nThe table must contain the following columns:\n\n| Column name | Type |\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `user_id` | `string` The id of a user who visits the touchpoint. (Must not be NULL or 0.) |\n| `event_time` | `int` The time when the contribution event happened. (Must not be NULL.) |\n| `credit` | `integer` The credit contributed by the user. It can be any credit one would like to analyze. For example, the conversion value, the number of conversions, etc. It must be between 1 and 100. |\n\n| **Note:** If a single user has multiple conversion events, upload them as you would any other events. Ensure that no events use a duplicative pair of `user_id` and `event_time`.\n\nSample code for creating the table: \n\n\n CREATE TABLE user_credit_temp_table AS (\n SELECT\n user_id,\n MAX(event.event_time) AS event_time,\n 1 AS credit\n FROM adh.cm_dt_activities_attributed\n WHERE user_id \u003c\u003e '0'\n AND event.campaign_id IN UNNEST(@campaign_ids)\n AND DATE(TIMESTAMP_MICROS(event.event_time)) BETWEEN @start_date AND @end_date\n AND event.activity_id IN UNNEST (@activity_ids)\n GROUP BY user_id\n );\n\nThe table-valued function\n-------------------------\n\nThe table-valued function is a function that returns a table as a result. As such, you can query the table-valued function as you would a normal table.\n\n### Syntax\n\n ADH.TOUCHPOINT_ANALYSIS(TABLE touchpoints_tmp_table_name, TABLE credits_tmp_table_name, STRING model_name)\n\n### Arguments\n\n| Name | |\n|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `touchpoints_tmp_table_name` | The name of the client-created temp touchpoint table. The table is required to have schema which contains the columns of `touchpoint`, `user_id`, and `event_time`. |\n| `credits_tmp_table_name` | The name to the client-created temp user credit table. The table is required to have schema which contains the columns `user_id`, `credit`, and `conversion_time`. |\n| `model` | `string` Must be MARKOV_CHAINS. |\n\n### Output table\n\nThe output table will contain the following schema:\n\n| Column name | Type |\n|--------------|--------------------------------------------------------------|\n| `touchpoint` | `string` Touchpoint name. |\n| `score` | `integer` Calculated Markov chain score for this touchpoint. |\n\n### Sample code for using the table-valued function\n\n SELECT *\n FROM ADH.TOUCHPOINT_ANALYSIS(\n TABLE tmp.touchpoint_temp_table,\n TABLE tmp.user_credit_temp_table,\n 'MARKOV_CHAINS')"]]