>_bandit
changelog

Reward mode: weighted depth

How the bandit decides which article is better when Weighted depth is selected.


TL;DR

The bandit does not look at purchases only. It asks: how far did the visitor go in the funnel after this article?

Opened the page — few points. Reached the store — more. Bought — maximum.

Each visit gets a score from 0 to 1. Per article we take the average. Higher average → more traffic (via Thompson Sampling).

Why: purchases are rare; on-site behavior exists for almost every visit. Even with zero sales you can see which article pushes people further.


Details

Funnel and weights

Each visitor has max_stage (0…7):

StageEventDefault weight
1Article page view0.05
2Scroll0.10
3CTA click0.30
4Store page0.45
5Add to cart0.65
6Begin checkout0.80
7Purchase1.00

Weights are editable in the product bandit settings.

Per-visit formula

reward=w[max_stage]w[7]\text{reward} = \frac{w[\max\_stage]}{w[7]}

If stage-7 weight is 1.0 (default), reward equals the stage weight.

Examples:

  • only opened the article (max_stage = 1) → (0.05)
  • reached the store (max_stage = 4) → (0.45)
  • purchased (max_stage = 7) → (1.0)

Bots and empty sessions are excluded.

Article score

mean_reward=AVG(reward)reward_sum=SUM(reward)α=1+reward_sumβ=1+journeysreward_sum\begin{aligned} \text{mean\_reward} &= \mathrm{AVG}(\text{reward}) \\ \text{reward\_sum} &= \mathrm{SUM}(\text{reward}) \\ \alpha &= 1 + \text{reward\_sum} \\ \beta &= 1 + \text{journeys} - \text{reward\_sum} \end{aligned}

Dashboard Effectiveness = (\text{mean_reward}).

How traffic share is formed

Usually Thompson Sampling: for each article sample from (\mathrm{Beta}(\alpha, \beta)) and pick the winner. Higher, more confident (\text{mean_reward}) wins more often — but not always: with little data others still get a chance.

While total journeys are below min_journeys, traffic stays uniform.


Example

Three articles, 100 visits each:

ArticleWhat happenedmean_reward (approx.)
AOften CTA clicks, rare buys~0.28
BFew people leave the article~0.08
CMany purchases~0.45

C leads. A still gets a solid share: people reach the store. B gets little until it improves.

With zero purchases everywhere, the bandit can still separate A from B by depth — that is the point of this mode.


When to use it

  • Little or no purchase-amount data
  • You care about engagement and path-to-store
  • Cold start

Switch the mode in product bandit settings. Effectiveness recomputes immediately after save.