uam
uam combines aggregated attribution and customer journey attribution in a single workflow.
If df_paths is not provided, uam returns the selected aggregated attribution baseline. If df_paths is provided, uam combines the selected aggregated baseline with Markov conversion-rate information from customer journeys.
By default, uam now uses reward_model as its aggregated-data baseline. The previous auto_mmm baseline behavior can still be selected explicitly with baseline_model = "auto_mmm".
Input structure
df_aggr should contain:
- a timestamp column
- one target or conversions column, passed separately through the
targetparameter - one or more aggregated signal columns
D_variables should be a table/data frame with one row per non-target signal variable and these columns:
| COLUMN | DESCRIPTION |
|---|---|
| variable | Name of the signal column in df_aggr. |
| channel | Final attribution channel associated with the signal. Multiple variables can map to the same channel. |
| measure | Measure type for the signal, such as impressions, clicks, cost, direct_searches, platform_signal, or another supported measure label. |
The old D_measures parameter is no longer used. Measure information must be provided inside D_variables.
df_paths is optional. When supplied, it can contain either:
- already aggregated customer journey paths, with columns such as
path,total_conversions, and optionallytotal_null; or - event-level customer journeys, with columns such as
id_path,timestamp, andtouchpoint.
For event-level journeys, the current API expects the channel/touchpoint column to be named touchpoint. The old event-level column name channel is no longer supported for UAM paths.
Parameters
| PARAMETER | TYPE | DEFAULT | DESCRIPTION |
|---|---|---|---|
| df_aggr | data.frame | Aggregated dataset with timestamp, target/conversions, and input signal columns. | |
| D_variables | data.frame / table | Table with variable, channel, and measure columns. | |
| target | str | "conversions" | Name of the target column in df_aggr. |
| df_paths | data.frame | NULL / None | Optional customer journey data used to blend aggregated and path-based attribution. |
| var_path | str | "path" | Column containing serialized customer journeys when aggregated paths are provided. |
| var_conv | str | "total_conversions" | Column containing conversions associated with each aggregated path. |
| var_null | str | "total_null" | Column containing null-path counts when available. |
| channel_conv | str | "((CONV))" | Conversion marker used in event-level customer journey data. |
| baseline_model | str | "reward_model" | Aggregated baseline model used by UAM. Allowed values are "reward_model" and "auto_mmm". |
| max_p | int | 12 | Maximum lag length considered in the aggregated baseline model. |
| nsim | int | 1000 | Number of simulations used when baseline_model = "auto_mmm". Ignored by reward_model. |
| seed | int | 1234567 | Random seed for reproducible results. |
| verbose | int / bool | 1 | Controls runtime logging. |
| order | int | 1 | Markov model order used for the path-based component. |
| sep | str | ">" | Path separator used inside serialized journey strings. |
| ncore | int | 1 | Number of cores used by the path-based computation. |
| server | str / list[str] | app.channelattribution.io | Server endpoint used by the hosted computation service. |
| password | str | NULL / None | Authentication token for the hosted service. |
| return_diagnostics | bool | FALSE / False | If enabled, returns attribution together with diagnostic objects for advanced inspection. |
Baseline selection
The default behavior is:
baseline_model = "reward_model"
To use the previous auto_mmm baseline behavior, set:
baseline_model = "auto_mmm"
When df_paths = NULL / None, uam returns the attribution from the selected baseline model.
When df_paths is provided, uam uses the selected baseline attribution and adjusts it with the Markov layer from the customer journey paths.
Output
If return_diagnostics = FALSE, the function returns an attribution data frame.
If return_diagnostics = TRUE, the returned list/dict may include:
| OUTPUT | TYPE | DESCRIPTION |
|---|---|---|
| attribution | data.frame | Final channel attribution by time period. |
| baseline_model | str | Baseline model used by UAM: "reward_model" or "auto_mmm". |
| parameters_baseline | list / dict | Diagnostics from the selected aggregated baseline model. |
| parameters_mmm | list / dict | Backward-compatible alias for baseline diagnostics. |
| parameters_mta_adjusted | list / dict | Adjusted parameters used by the path-based Markov component. |
| mode | str | Execution mode metadata, such as reward_model_baseline_only or reward_model_baseline_markov_limited_adjustment. |
| raw_score_formula | str / object | Diagnostic information about the raw score formulation. |
| final_adjustment_formula | str / object | Diagnostic information about the final adjustment formulation. |
| row_sum_check | list / dict | Diagnostics checking that row sums remain consistent after adjustment. |