uam
R
library(ChannelAttributionPro)
token <- "yourtoken"
df_aggr <- read.csv("https://app.channelattribution.io/data/data_aggregated.csv", sep = ";")
D_variables <- list(
conversions = "target",
A = "channel_a",
B = "channel_b",
C = "channel_c",
D = "channel_d",
E = "channel_e",
F = "channel_f"
)
D_measures <- list(
A = "clicks",
B = "impressions",
C = "impressions",
D = "clicks",
E = "clicks",
F = "clicks"
)
res <- uam(
df_aggr = df_aggr,
D_variables = D_variables,
D_measures = D_measures,
df_paths = NULL,
max_p = 12,
nsim = 1000,
seed = 1234567,
verbose = 1,
password = token
)
print(head(res))
With customer journey paths:
df_paths <- read.csv("https://app.channelattribution.io/data/data_paths_t.csv", sep = ";")
res <- uam(
df_aggr = df_aggr,
D_variables = D_variables,
D_measures = D_measures,
df_paths = df_paths,
var_path = "path",
var_conv = "total_conversions",
var_null = "total_null",
order = 1,
sep = ">",
verbose = 1,
password = token
)
print(head(res))