---
title: "Layered and prioritized experiences"
url: "https://developers.contentstack.com/guides/personalize-with-ssr-at-the-edge/layered-and-prioritized-experiences"
type: "guide_chapter"
level: "advanced"
intent: "learn"
outcome: "You can predict which content renders when a visitor qualifies for several experiences, and design experiences so they do not fight each other."
prerequisites:
  - "The edge setup from the earlier chapters"
  - "Two or more experiences in one Personalize project"
tags:
  - "personalization"
  - "sdk"
  - "next"
authors:
  - "Tim Benniks"
published: "2026-11-15T10:19:18.311Z"
updated: "2026-11-15T10:55:41.481Z"
---

# Layered and prioritized experiences

- **Authors:** Tim Benniks
- **Published:** 2026-11-15T10:19:18.311Z
- **Updated:** 2026-11-15T10:55:41.481Z
- **Level:** Advanced
- **Intent:** Learn
- **Tags:** personalization, sdk, next

---

A real visitor fits more than one bucket. They came from a spring campaign, they are on a phone, and they are in Germany. Personalize lets each of those facts drive its own experience, and the edge setup from this guide already supports that: the manifest lists every active experience, and the CDA layers every matching entry variant. What you need to control is what happens when two of them want the same field.

## What you'll learn

- How priority works inside one experience and across experiences


- How layering resolves on the CDA


- When to pick a segmented experience and when an A/B test


- How to scope experiences with tags


- Design rules that avoid conflicts



## Two kinds of priority

There are two separate orders, and people mix them up.

Variant priority lives inside a segmented experience. When a visitor matches the audiences of several variants, the first one in the experience's variant list wins. You reorder variants by dragging them in the experience configuration. Put the most specific audience first: "VIP customers" above "Visitors from the UK", or the VIP variant never shows for UK VIPs.

Experience priority lives across experiences in a project. By default, experiences are ordered by creation date, newest at the bottom. You change the order with Prioritize Experiences in Personalize. The experience at the top wins when two experiences touch the same content.

## How layering resolves

Take two active experiences on the pricing page:

Experience

Short UID

Priority

Changes on the pricing_page entry

Spring campaign

a

1

hero_title, hero_image

EU visitors

b

2

hero_title, currency_note

A visitor from Germany who arrived from the campaign gets the manifest a=0, b=0. The edge function sends personalize_variants=a_0,b_0, and the origin passes ['cs_personalize_a_0', 'cs_personalize_b_0'] to variants().

The CDA merges per field:

- hero_title: both override it. The first alias wins, so the visitor sees the campaign title.


- hero_image: only the campaign overrides it.


- currency_note: only the EU experience overrides it.


- Every other field comes from the base entry.



flowchart TB    B[Base entry] --> M{Merge per field}    A0["cs_personalize_a_0 (priority 1)"] --> M    B0["cs_personalize_b_0 (priority 2)"] --> M    M --> T["hero_title from a_0"]    M --> I["hero_image from a_0"]    M --> C["currency_note from b_0"]    M --> R[All other fields from base]The result is one entry that reflects both facts about the visitor. When experiences target different sections or different entries, there is no conflict at all, and each section shows its own variant.

Production note: The order of aliases is the priority. The SDK returns them sorted, highest priority first. If you build aliases yourself, for example from a non-JavaScript origin calling the Edge API directly, keep the manifest order.

## Segmented or A/B test

Both experience types produce the same aliases and use the same delivery code. The difference is how the variant gets picked and what you learn from it.


Segmented

A/B test

Picks the variant by

First matching audience, in variant order

Traffic split among visitors in the target group

Answers

"Show EU visitors the EU offer"

"Does headline B convert better than A?"

Needs metrics

No, impressions are optional

Yes, at least a primary metric

Traffic options

Not applicable

Equal split, custom split, Multi-Armed Bandit

Use segmented when you already know what each group should see. Use an A/B test when you do not know and want data. A common pattern is both: an A/B test inside one audience, such as testing two hero headlines only for returning visitors, by setting that audience as the test's target group (Selective) instead of Everyone.

A/B assignment sticks to the user UID for the duration of the test. A returning visitor with the same cs-personalize-user-uid cookie keeps their variant. If the cookie is cleared, they can land in a different variant, which is one more reason to persist the cookie with addStateToResponse() at the edge.

Custom split is useful for soft launches: send 20 percent of traffic to a redesigned page and keep 80 percent on the current one. Multi-Armed Bandit starts equal and shifts traffic toward the better-converting variant while the test runs, while every variant keeps a minimum share.

## Scope experiences with tags

Every experience the edge evaluates can add a variant to the URL, and every combination is a separate cache entry. If your checkout experiences have nothing to do with the blog, there is no reason to evaluate them on blog pages.

Tag experiences in Personalize, for example section:checkout or section:marketing, and pass the tags at initialization:

```javascript
const section = url.pathname.startsWith('/checkout') ? 'section:checkout' : 'section:marketing';

const sdk = await Personalize.init(context.env.NEXT_PUBLIC_CONTENTSTACK_PERSONALIZE_PROJECT_UID, {
  request,
  tags: [section],
});
```

Only experiences with at least one matching tag are returned. Matching is case-insensitive, and you can pass up to 10 tags. Without tags, the edge evaluates every eligible experience.

Tags also work for environments. Tag test experiences env:staging and production ones env:production, and initialize with the tag for the current deployment, instead of keeping a separate Personalize project per environment.

## Design rules that keep layering predictable

- Give each experience a job. One experience per decision, such as "campaign hero" or "regional pricing note". Avoid two experiences that both rewrite the whole page.


- Overlap on purpose. If two experiences must touch the same field, decide the priority before activating, not after a stakeholder sees the wrong headline.


- Keep A/B tests away from contested fields. If a higher-priority segmented experience overrides the field under test, part of your test traffic never sees the tested variant, and the result is skewed.


- Watch the cache. Each added experience multiplies the possible variant combinations. Tags and fewer, broader experiences keep hit rates up.



## Where people usually get confused

### Confusion 1: Experience priority does not pick variants

Experience priority only matters when two experiences override the same field. It does not stop a lower-priority experience from being active.

### Confusion 2: Reordering is live

Changing experience priority changes what visitors see on the next manifest. Pages already in the CDN cache keep the old merge until they expire or you revalidate.

### Confusion 3: "No variant" is a valid result

A segmented experience where no audience matches returns null for that visitor. The experience adds nothing to the URL and the base content renders. That is expected, not a bug.

## Key takeaways

- Inside a segmented experience, the first matching variant wins; order variants from specific to general.


- Across experiences, the top of Prioritize Experiences wins field conflicts on the same entry.


- The first alias wins a field conflict on the CDA, so keep the SDK's alias order intact.


- Use segmented when you know the answer and A/B tests when you need one.


- Pass tags to Personalize.init() to keep unrelated experiences out of the manifest and the cache key.





---

## Do this with AI

Install the personalize skill from [Contentstack agent skills](https://github.com/contentstack/contentstack-agent-skills) and connect the Personalization Strategist profile in MCP Profile Hub. Then ask your agent:

> List every active experience that targets the home page with its priority and audiences, and flag pairs that could set variants on the same entry for the same visitor.

New to this? [Set up your AI workbench](/guides/set-up-your-ai-workbench-for-contentstack) first.




---

## Frequently asked questions

### What happens when two experiences change the same field of the same entry?

The higher-priority experience wins. Its alias comes first in the variant list, and the CDA lets the first alias win a field conflict.

### How do I change experience priority?

In Personalize, use the Prioritize Experiences option and drag experiences into order. The top of the list has the highest priority.

### What decides the variant inside a segmented experience?

Variant order. The first variant whose audience conditions match the visitor becomes active.

### Can I limit which experiences the edge evaluates?

Yes. Tag experiences and pass tags to Personalize.init(). Only experiences with at least one matching tag are returned.



---

## Chapter Navigation

**← Previous:** [Track impressions and conversions](https://developers.contentstack.com/guides/personalize-with-ssr-at-the-edge/track-impressions-and-conversions)

