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.

A/B Variants ON
Variants:
234
Experience A

Headline

Save 20% today

CTA Label

Shop Now

CTA URL

/sale

Background

#1a1a2e
Experience B

Headline

Limited offer

CTA Label

Claim Deal

CTA URL

/sale

Background

#0f2027

// Experience A — Save 20% today

const cfg = {

headline: "Save 20% today",

ctaLabel: "Shop Now",

bgColor: "#1a1a2e",

...

}

How to use it

1

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.

2

Configure the shared base

Set up the experience in the main configurator as normal — trigger, frequency, style, integrations. These settings apply to every variant.

3

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.

4

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.

5

Click Generate

One script is produced per active variant. The code output switches to a tabbed view — Experience A, Experience B, and so on.

6

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.

💡Copy from base
If your variants are mostly the same, click Copy from base in each variant panel to pre-fill all fields from the shared config. Then change only what differs — usually just the headline and CTA.

Setting up the Target activity

Each generated script maps to one experience in an Adobe Target A/B activity. The recommended setup:

1

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.

2

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.

3

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.

4

Repeat for remaining experiences

Switch to Experience B in the VEC, paste the Experience B script. Repeat for C and D if applicable.

5

Set goals and activate

Configure your success metric — click, conversion, revenue — set traffic allocation, and activate the activity.

📝One modification per experience
Each generated script is self-contained — it includes all logic, styling, and config for that experience. You do not need to add any extra modifications in the VEC beyond the single Custom Code block.

What can be overridden

FieldModalBannerCountdown
Headline
Body copy
CTA label
CTA URL
Background colour
Accent colour
📝What can't be overridden
Trigger type, frequency, animation, and experience type (e.g. modal vs. coupon) are shared across all variants. If you need different trigger logic per experience, generate each script separately in single-experience mode.

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.

Get in touch