Guides
A/B Variant Generator
Generate up to 4 independent experience scripts from one shared base config — one script per Target experience.
What it does
The A/B Variant Generator is a mode available in the Modal, Banner, and Countdown builders. Toggle it on, set how many variants you need (2–4), fill in what's different per experience — headline, CTA text, colours — and click Generate. You get one complete, deployment-ready script per experience.
Everything you configured in the main builder — trigger, frequency, animation, style, integrations — is shared across all variants automatically. The override panels only expose the fields that actually differ between experiences.
Headline
CTA Label
CTA URL
Background
Headline
CTA Label
CTA URL
Background
// Experience A — Save 20% today
const cfg = {
headline: "Save 20% today",
ctaLabel: "Shop Now",
bgColor: "#1a1a2e",
...
}
How to use it
Toggle A/B Variants on
Click the "A/B Variants" button in the configurator header. Variant count defaults to 2. You can raise it to 3 or 4 using the pill buttons that appear.
Configure the shared base
Set up the experience in the main configurator as normal — trigger, frequency, style, integrations. These settings apply to every variant.
Fill in the override panels
Each variant gets its own panel — Experience A, B, C, D. Fill in only the fields that differ: headline, body copy, CTA label, CTA URL, background colour, accent colour. Use the "Copy from base" button to pre-fill a panel from your current base config, then tweak it.
Leave blank to inherit
Any field you leave empty in a variant panel inherits the value from the shared base. You only need to fill in what's actually different.
Click Generate
One script is produced per active variant. The code output switches to a tabbed view — Experience A, Experience B, and so on.
Copy each script into Target
In your Adobe Target A/B activity, open each experience in the VEC, add a Custom Code modification, and paste the corresponding script. Experience A script → Experience A in Target. Experience B script → Experience B. Repeat per variant.
Setting up the Target activity
Each generated script maps to one experience in an Adobe Target A/B activity. The recommended setup:
Create a new A/B Test activity
In Target, choose Activities → Create Activity → A/B Test. Add as many experiences as you have variants (2–4). Name them to match — Experience A, Experience B, etc.
Open the VEC for Experience A
Navigate to the page where the experience should appear. In the VEC, select the element where the experience will inject (or use Insert Before/After Body), then choose Custom Code.
Paste the Experience A script
Copy the Experience A script from the A/B Variant Generator and paste it into the Custom Code editor. Save.
Repeat for remaining experiences
Switch to Experience B in the VEC, paste the Experience B script. Repeat for C and D if applicable.
Set goals and activate
Configure your success metric — click, conversion, revenue — set traffic allocation, and activate the activity.
What can be overridden
| Field | Modal | Banner | Countdown |
|---|---|---|---|
| Headline | ✓ | ✓ | ✓ |
| Body copy | ✓ | — | — |
| CTA label | ✓ | ✓ | ✓ |
| CTA URL | ✓ | ✓ | ✓ |
| Background colour | ✓ | ✓ | ✓ |
| Accent colour | ✓ | ✓ | ✓ |
Available in
🧪 Need help structuring A/B tests in Adobe Target?
We can help you design experiments, set up variant scripts, choose success metrics, and interpret results — from hypothesis to activation.