adobe / adobe/aem-experimentation

getAssignment: external experiment assignment (don't randomize)

Open
#68 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
16
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Part of #66

## Problem

Experiments self-bucket client-side (`ued.evaluateDecisionPolicy`); the only override is a `?experiment=id/variant` query param. There is no clean way to say *"the arm comes from my engine — don't randomize"* while still letting the plugin render the variant and report. This was the biggest gap: a BYO experiment currently has to be modeled as an audience/campaign instead.

## Proposal

A pluggable assignment provider the engine owns:

```js
loadEager(document, {
getAssignment: async (experimentId, context) => variant, // e.g. 'challenger-1' | 'control'
});
```

When provided, the plugin **skips client-side randomization** for that experiment and renders + reports the returned variant. Sticky assignment and exposure stay the engine's responsibility.

## Acceptance criteria

- [ ] When `getAssignment` returns a variant, the plugin serves it and does not re-bucket.
- [ ] When absent (default), current self-bucketing is unchanged.
- [ ] `?experiment=` override still wins for QA.
- [ ] Works across the experiment fidelity levels the plugin already supports.

Contributor guide

Open the contributing guide

Research direction

Start at the loadEager entry point and trace how ued.evaluateDecisionPolicy, the experiment query-parameter override, and existing fidelity levels choose a variant. Verify the assignment-provider path skips re-bucketing, preserves the default behavior and QA override, and serves and reports the returned variant across supported fidelity levels.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.