Why Integrate Target with AEM?
Adobe Target and AEM work great together. AEM handles your content. Target handles personalization. When connected, you can:
- Run A/B tests on AEM pages without developer help
- Personalize content based on visitor behavior, location, or segments
- Export Experience Fragments from AEM to use as Target offers
- Use the Visual Experience Composer to edit AEM pages in Target
- Track results with Analytics for Target (A4T) reporting
Integration Methods
How you connect depends on your AEM version:
| AEM Version | Method | Authentication |
|---|---|---|
| AEM Cloud Service | Adobe IMS (required) | Adobe Developer Console |
| AEM 6.5 | Adobe IMS (recommended) | Adobe Developer Console |
| AEM 6.5 | Legacy Cloud Config | Client Code + API Token |
| AEM 6.4 and older | Legacy Cloud Config | Client Code + API Token |
Use Adobe IMS whenever possible. It's more secure and required for Cloud Service. Legacy authentication still works but Adobe may deprecate it.
Prerequisites
Before you start, make sure you have:
- Admin access to AEM (author instance)
- Admin access to Adobe Target
- Access to Adobe Admin Console (for IMS setup)
- Your Target tenant code (found in Target UI under Setup > Implementation)
- Your IMS Organization ID
Step-by-Step: IMS Integration (AEM Cloud Service & 6.5)
1 Create Adobe I/O Project
Go to Adobe Developer Console and create a new project:
- Click "Create new project"
- Add API → Select "Adobe Target"
- Choose "Service Account (JWT)" or "OAuth Server-to-Server"
- Generate or upload a certificate (for JWT)
- Save your credentials
2 Configure IMS in AEM
In AEM, go to Tools → Security → Adobe IMS Configurations:
- Click "Create"
- Select "Adobe Target" as the cloud solution
- Enter your IMS Organization ID
- Paste the API Key (Client ID) from Developer Console
- Paste the Client Secret
- Add your certificate (for JWT auth)
- Click "Create"
3 Create Target Cloud Configuration
Go to Tools → Cloud Services → Adobe Target:
- Click "Create" and choose a configuration folder
- Enter a title (e.g., "Adobe Target Production")
- Select the IMS configuration you just created
- Enter your Target tenant code (e.g., "mycompany")
- Select your Target client code
- Click "Connect to Target" to verify
- Save the configuration
4 Apply to Your Site
Link the configuration to your site:
- Go to Sites console
- Select your site root
- Click Properties → Cloud Services
- Add the Adobe Target configuration
- Save and close
Using Experience Fragments with Target
Experience Fragments (XF) are a powerful way to manage Target offers in AEM. You create content in AEM, export it to Target, and use it in activities.
Export an Experience Fragment
- Open the Experience Fragment editor
- Create or edit your fragment variation
- Click the Export to Target action in the toolbar
- Select your Target configuration
- Choose "Export as HTML" or "Export as JSON"
- Click Export
The fragment appears in Target under Offers → Code Offers.
Name your XF variations clearly (e.g., "Homepage Hero - Promo A"). This makes them easy to find in Target when building activities.
Experience Fragment Offer Structure
// Target offer created from XF export
{
"name": "homepage-hero-promo-a",
"type": "html",
"content": "<div class='hero'>...</div>",
"modifiedAt": "2025-01-15T10:30:00Z",
"workspace": "default"
}
Visual Experience Composer with AEM
The Visual Experience Composer (VEC) lets you edit pages visually in Target. To use it with AEM, you need to configure CORS and possibly your dispatcher.
Enable VEC Access
Add these headers to your AEM dispatcher or CDN:
# Dispatcher config for VEC
<IfModule mod_headers.c>
# Allow Target VEC to frame your pages
Header always set X-Frame-Options "ALLOW-FROM https://experience.adobe.com"
# Or use Content-Security-Policy
Header always set Content-Security-Policy "frame-ancestors 'self' https://experience.adobe.com"
# CORS for Target API calls
Header always set Access-Control-Allow-Origin "https://experience.adobe.com"
Header always set Access-Control-Allow-Methods "GET, POST, OPTIONS"
Header always set Access-Control-Allow-Headers "Content-Type, Authorization"
</IfModule>
If VEC can't load your page, try the Enhanced Experience Composer (proxy mode) or install the VEC Helper browser extension. These bypass most CORS issues.
Analytics for Target (A4T)
A4T lets you use Adobe Analytics as the reporting source for Target activities. This gives you richer data and avoids duplicate tracking.
Enable A4T
- Ensure Analytics and Target share the same IMS org
- In Target, go to Administration → Reporting
- Select "Adobe Analytics" as default reporting source
- Choose your Analytics report suite
- In AEM, make sure both Analytics and Target cloud configs are applied to your site
A4T Data Flow
With A4T enabled:
- Target activity impressions go to Analytics
- Success metrics are measured in Analytics
- Reports appear in both Target and Analytics Workspace
- You can segment Target data by any Analytics dimension
Common Integration Patterns
Pattern 1: XF-Based Personalization
Best for: Content-heavy sites managed by marketers
- Create Experience Fragment variations in AEM
- Export variations to Target
- Build Target activity using XF offers
- Target decides which variation to show
Pattern 2: VEC-Based Testing
Best for: Quick A/B tests without AEM changes
- Open VEC in Target
- Load your AEM page URL
- Make visual edits (text, images, layout)
- Set up audience targeting
- Launch the activity
Pattern 3: Form-Based Activities
Best for: Single-page apps, headless AEM
- Create mbox locations in your code
- Build activity using Form-Based Composer
- Return JSON offers from Target
- Render content client-side
Troubleshooting
| Issue | Solution |
|---|---|
| IMS connection fails | Check certificate expiration, verify API credentials, ensure correct IMS org |
| XF export fails | Verify Target cloud config, check user permissions, review error logs |
| VEC won't load page | Check CORS headers, try Enhanced EEC, use VEC Helper extension |
| Activity not showing | Verify at.js is loaded, check activity status, clear browser cache |
| A4T data missing | Ensure Analytics tracking fires, verify SDID stitching, check report suite |
Best Practices
- Use IMS auth — It's more secure and future-proof than legacy tokens.
- Organize XFs clearly — Create folders by campaign or page type.
- Enable A4T — Unified reporting saves time and gives better insights.
- Test in lower environments — Always verify on stage before production.
- Document your setup — Record tenant codes, configs, and permissions.
Conclusion
Integrating Adobe Target with AEM unlocks powerful personalization. Start with the IMS setup, test Experience Fragment exports, and explore the Visual Experience Composer. Once connected, your content team can run tests without developer help.
The key is getting the foundation right. A proper IMS configuration and clear XF naming conventions make everything else easier.
Related Topics
Need Help with Target + AEM Integration?
Our team at WegWorks has set up Target integrations for many AEM sites. We can help you get it right the first time.
Get Expert Help