Guides

🔬

VEC Workflow Guide

A step-by-step walkthrough of building an Adobe Target activity with the Visual Experience Composer, from opening a URL to activating.

End-to-end workflow

1

Run VEC Preflight

Before opening the VEC, use Experience Lab's VEC Preflight Checker to confirm your page loads in an iframe and has no CSP or X-Frame-Options blockers. Fix any issues before proceeding.

2

Create a new activity in Adobe Target

Log into Adobe Target → Activities → Create Activity → A/B Test, Experience Targeting, or Multivariate Test. Choose Visual Experience Composer. Enter your page URL and click Create.

1Click Activities in the top nav
2Click Create Activity → choose A/B Test, Experience Targeting, or Multivariate Test → select Visual Experience Composer
experience.adobe.com/#/@org/target/activities
AAdobe Target
1ActivitiesAudiencesOffersRecommendationsAdministration

All Activities

2
A/B TestVEC + Custom Code
Experience TargetingVEC + Custom Code
Multivariate TestVEC + Custom Code
Automated Personalizationnot recommended
Recommendationsnot VEC
Search activities…
6 activities
TypeNameStatusLast Updated
XTHomepage Banner — Summer PromoLiveApr 14, 2026
A/BCheckout CTA Variant TestLiveApr 12, 2026
XTEmail Capture Modal — Exit IntentInactiveApr 10, 2026
XTCountdown Timer — Flash SaleLiveApr 08, 2026
A/BSticky Bar Notification TestInactiveMar 30, 2026
XTProduct Page PersonalisationLiveMar 22, 2026

* Automated Personalization — AP's algorithm controls delivery, which conflicts with Experience Lab's trigger and frequency logic.

* Recommendations — Uses a dedicated criteria-based composer, not the VEC. Custom Code modifications don't apply.

3

Let the VEC load your page

Target opens your URL in an iframe inside the VEC. If the page fails to load, install the Adobe Experience Cloud Visual Editing Helper Chrome extension — it handles iframes, CSP headers, and cookie issues.

4

Add a Custom Code modification

In the VEC modifications panel, click the '+' button → Insert After (or Custom Code). This opens a code editor where you'll paste your Experience Lab script.

1Click the Modifications panel icon (below the + button) to open the Modifications panel
2Click ···Add a modification → change type to Custom code
3Paste your script into the Content area → click Edit Content to open the full editor → Save
experience.adobe.com — Visual Experience Composer
AMy Experience Lab Activity — Homepage Modal
ExperiencesTargetingGoals & Settings
+Modifications
DeviceFit 1882 px
No Modifications
Modifications will appear here when objects have been modified
Add a modification
Add a modification
Delete all modifications
Delete all invalid modifications
Add a modification
CSS Selector
CSS Selector
Custom codeselect
Mbox
Add a modification
Custom code

The code below will be injected in the HEAD section of the page.

Add code in the <head> section
<script>
// Experience Lab — generated code
(function () {
function waitForBody(cb) {
if (document.body) return cb();
var t = setInterval(function () {
clearInterval(t); cb(); }
}, 50);
}
waitForBody(function () {
// render modal…
});
})();
</script>
Special Offer
Scan for 20% off
Limited time offer

* Edit Content — Opens a full-screen code editor. Use this rather than the inline Content box for Experience Lab scripts — the full editor handles long scripts without truncation.

* Modification type defaults to CSS Selector — You must change it to Custom code to unlock the HEAD injection option and the script content area.

5

Generate your script in Experience Lab

Configure your modal, banner, or countdown in Experience Lab, then copy the generated script from the code output panel.

1Select your tool type and configure the trigger, frequency, and appearance settings
2Click Copy Code to copy the generated script to your clipboard
experiencelab.app/modal
Experience Lab
ModalBannerCountdownSticky Bar
Configuration
Tool
Modal
Trigger
Page Load Delay3 s
Frequency
Once Per Session
Overlay
Dark60%
Position
Centered
Animation
Fade In300 ms

Saved Presets

Homepage PromoExit Intent TestFlash Sale
Preview
Get 20% Off Today
Claim Offer
fires after 3s
Generated Codemodal · 3s delay · once
1234567891011121314151617
<script>(function () { var KEY = 'el-modal-x7k2'; if (localStorage.getItem(KEY)) return; localStorage.setItem(KEY, '1'); // waitForBody + render… function render() { var el = document.createElement('div'); el.id = KEY; // styles injected here document.body.appendChild(el); } waitForBody(function () { setTimeout(render, 3000); });})();</script>
Script ready
17 lines · ~680 bytes

* Generate first, paste second — Always configure and copy your script in Experience Lab before switching back to the VEC tab. The clipboard persists, so you can paste immediately into the Custom Code editor without losing your work.

6

Paste the script into VEC Custom Code

Paste the copied script into the VEC Custom Code editor. Click Save. The preview panel should update to show your experience overlaid on the page.

1Click Edit Content, paste your script, then click Save to close the code editor
2Back in the Edit modification panel — click Save again to apply the modification to the VEC
experience.adobe.com/#/@org/target/activities/edit-activity/experience_targeting/…
AAdobe Target
ActivitiesAudiencesOffersRecommendationsAdministration
XTMy Experience Lab Activity — Homepage Modal
ExperiencesTargetingGoals & Settings
Audiences
+
All Visitors
···
Experience A
Configure
Device Fit ∨1882 px
COMMU
Edit modification×
Action
Set Custom Code
CSS Selector
HEAD
Add code in the <head> section
Content
<script>
/**
* Generated: 2026-04-16 via
* Experience Lab (experiencelab.app)
* Tool : Modal
* Trigger : Page load (delay: 3s)
*/
(function () {
var KEY = 'el-modal-x7k2';
Edit Content
1
1234567891011121314151617181920
<script>
/**
* Generated: 2026-04-16 via
* Experience Lab (experiencelab.app)
* Tool : Modal
* Trigger : Page load (delay: 3s)
*/
(function () {
var KEY = 'el-modal-x7k2';
if (localStorage.getItem(KEY)) return;
localStorage.setItem(KEY, '1');
function render() {
var el = document.createElement('div');
document.body.appendChild(el);
}
waitForBody(function () {
setTimeout(render, 3000);
});
})();
</script>
JavaScript · 20 lines · ready to saveLn 20, Col 10

* Two saves required — The first Save closes the code editor and returns you to the Edit modification form. The second Save commits the modification to the VEC activity. Skipping the second Save means your script won't be part of the activity.

7

Set targeting and goals

In the Experiences tab, you can click the audience label beneath each experience (defaults to All Visitors) to open the audience picker and assign a specific audience. You can also refine this in the Targeting step — set traffic allocation and define success metrics (typically a click goal or a conversion page view).

💡Audience options for testing vs. production
All Visitors is safe for testing— as long as the activity remains in draft and is never activated, it won't affect real traffic. Use All Visitors to QA your script without restriction.

For production targeting, create a custom audience in the picker using your Adobe Experience Cloud ECID (Experience Cloud ID). In the Add Audiences dialog, search your Audience Library for an ECID-based segment, or click Create Audience to build one from scratch — this lets you target specific visitor profiles without touching All Visitors traffic.
8

QA the activity

Use Target's QA links to preview each experience in your browser without affecting live traffic. Check both desktop and mobile. Verify the script fires correctly.

1Copy the QA URL for Experience A and open it in your browser — you'll see the activity without affecting live traffic
2Share QA links with stakeholders for sign-off, then click Done to return to the activity overview
experience.adobe.com/#/@org/target/activities/activity-details/…/overview
AAdobe Target
ActivitiesAudiencesOffersRecommendationsAdministration
XTMy Experience Lab Activity — Homepage Modal
Inactive
Overview
Reports
Collisions
Change Log
Activity QA
Information
Activity NameMy Experience Lab Activity — Homepage ModalActivity URLhttps://yoursite.com/landing
QA URLs

QA URLs let you view an activity's content at any time. You will stay in the experience as you browse to other pages on the site. Install Target's bookmark to exit Activity QA.

Match audience rules to see experiences
Show default content for all other activities
Experience A
https://yoursite.com/landing?at_preview_token=xK9mPqR2abc&at_preview_index=1&at_preview_listed_activities_only=true
9

Activate

Once QA passes, click Activate. Your activity is live. Monitor the Results tab — Target needs roughly 200 conversions per experience before results reach statistical significance.

1Click the Inactive status button in the top-right corner to open the status dropdown
2Click Activate — your activity goes live and begins serving the experience to real visitors
experience.adobe.com/#/@org/target/activities/activity-details/…/overview
AAdobe Target
ActivitiesAudiencesOffersRecommendationsAdministration
XTMy Experience Lab Activity — Homepage Modal
Activate
Archive
Overview
Reports
Collisions
Change Log
WorkspaceDefault WorkspaceActivity Location
https://yoursite.com/landing
ObjectiveIncrease engagementGoalI want to… increase engagement
Measured by: Page Views
Priority0Activity ID648029
Target
All Visitors
Experience A

Common pitfalls

⚠️Modal doesn't appear at all
Check the browser console for errors. Verify that at.js or Web SDK is loading on the page before the Target activity fires. If using a 0ms page-load trigger, try increasing it to 500ms to ensure the DOM is ready.
⚠️Script fires on every page load after navigating away
This is frequency capping working incorrectly. Check your Frequency section settings — make sure "Show Once Per Session" or a specific frequency cap is enabled. Verify localStorage is not being cleared on each page load.
⚠️VEC won't load the page — blank or error
Your page has an X-Frame-Options or CSP header blocking iframes. Run the VEC Preflight Checker for exact diagnostics and fix instructions. As a workaround, use the Form-Based Composer or the Enhanced Experience Composer (EEC) if your organisation has it enabled.
💡Use QA mode extensively
Target's QA links let you force-preview an activity in any browser without affecting live traffic allocation. Share QA links with stakeholders for sign-off before activation.

Anatomy of a generated script

Every Experience Lab script follows the same structure, regardless of which tool generated it:

generated-script-anatomy.js
<script>
(function() {
  // 1. waitForBody — polls until document.body exists
  //    Ensures safe execution regardless of at.js timing
  function waitForBody(cb) {
    if (document.body) return cb();
    var t = setInterval(function() {
      if (document.body) { clearInterval(t); cb(); }
    }, 50);
  }

  // 2. Frequency check — reads/writes localStorage
  //    Returns early if the visitor has already seen this experience
  function checkFrequency() { /* ... */ }

  // 3. Main render — injects the DOM element
  function render() {
    var el = document.createElement('div');
    el.id = 'el-modal-xxxx';
    // ... styles and content applied here
    document.body.appendChild(el);
  }

  // 4. Trigger logic — decides when to call render()
  //    Could be immediate, timed, scroll-based, or exit-intent
  waitForBody(function() {
    if (!checkFrequency()) return;
    setTimeout(render, 3000); // example: 3s delay trigger
  });
})();
</script>
📝Why the IIFE?
The immediately-invoked function expression (IIFE) wraps everything in a private scope so your variables don't collide with other scripts on the page or with other Target activities running simultaneously.

🎯 Need help building your first VEC activity?

Experience Lab can help you set up A/B tests, configure audiences, and write the custom code that goes into your VEC activities — from scratch or on top of an existing implementation.

Get in touch