Implementing the Personalization Engine - Combined Dimensions
- Last Modified:
- 16 Nov 2026
- User Level:
- Administrator
This is part 4 on our series of implementing the Personalization Engine.
In the previous parts, we covered how to set up the Personalization Engine and manage the Geo dimension, how to use the Postal code dimension, and how to use the behavioral dimensions. This part covers how to create personalized content for multiple of these dimensions at the same time.
Overview
A combined switcher matches on more than one dimension at once, then shows whichever eligible variant is the most specific match for that visitor. Use it when you need to target a precise overlap of signals: a Florida visitor who is a prospective undergraduate and partway through applying, say. It still falls back gracefully if only some of those signals are known.
This is the most powerful pattern the engine offers, and also the easiest one to get wrong. Treat geo, postal code and behavioral personalization as your default approaches, and only reach for this one when a single dimension genuinely can't say what you need it to say.
How matching works
Set data-query="combined" on the wrapper. Each variant then declares codes for whichever dimensions it cares about, using data-geo, data-postal-code, data-persona, and data-topic. A variant doesn't need all dimensions set: it can declare just one or two, and leave the rest out.
Interest isn't supported in combined switchers.
Example:
<div data-switcher data-query="combined" data-priority="topic:3,country:2,persona:1">
<!-- most specific: all three must match -->
<div data-variant="c1" data-geo="FL" data-persona="UG" data-topic="APPLYING" hidden>…</div>
<!-- partial fallbacks -->
<div data-variant="c2" data-geo="FL" data-persona="UG" hidden>…</div>
<div data-variant="c3" data-geo="FL" hidden>…</div>
<div data-variant="default" data-default>…</div>
</div>
In the code above, the variant c1 only shows to a visitor in Florida who's also a prospective undergraduate mid-application, since all three of its dimensions have to match. The next two are fallbacks for when less is known about the visitor: c2 needs just Florida and undergraduate, and c3 needs only Florida. If none of those match, the wrapper falls back to default, the same as any other switcher.
A variant only becomes eligible once every dimension it declares matches the visitor. This is AND logic: a variant with three dimensions needs all three to match, not just one or two.
Among the eligible variants, the engine picks whichever one scores highest. Each dimension a variant declares adds to its score, so a variant that matches on three dimensions usually outscores one that matches on fewer, depending on the weights below. That's how c1 wins over c2 and c3 for a Florida visitor who ticks all three boxes, without the engine needing to know anything about document order.
If two eligible variants somehow end up with the same score, the one that appears first in the markup wins. And if nothing is eligible at all, the wrapper falls back to the default variant, exactly as it would for a simpler switcher.
Each dimension also carries a default weight, which is what decides how much it adds to a variant's score: topic counts for 3, country for 2, postal code for 2, and persona for 1. If those defaults don't suit a particular wrapper, override them with data-priority, as in the example above (data-priority="topic:3,country:2,persona:1").
One thing to note: inside data-priority, postal code is written as postal-code, not postalcode like it is in data-query elsewhere, and geo can be written as either geo or country.
Why negation matters more here
data-geo still accepts the same country groups and ! exclusions covered in , for example data-geo="EU,!FR".
Negation matters more in a combined switcher than anywhere else, because of how scoring works. In a simple Geo switcher, the first matching variant in the markup wins, so a specific variant like France can sit above a broader one like the EU and always take priority. A combined switcher doesn't work that way: it picks whichever eligible variant scores highest, regardless of where it sits in the markup. That means a broad, heavily-weighted variant can quietly outrank a more specific one it was never meant to beat.
For example, say one variant declares data-geo="EU" data-persona="UG" and another declares just data-geo="FR". For a French visitor, both are eligible, and because the EU variant declares more dimensions, it scores higher and wins, even though the France-only variant is clearly the better match. The fix is to exclude France from the broad variant: data-geo="EU,!FR" data-persona="UG". That makes the EU variant ineligible for French visitors outright, so the France-specific variant wins as intended.
This is also how to target postal codes in a specific country. Since postal codes aren't tied to a country, pair them with data-geo. For example, data-geo="DE" data-postal-code="10*" only matches visitors in Germany whose postal code starts with 10.
Building it in Terminalfour
Unlike the previous parts, a combined switcher needs all the dimensions at once. Edit the Homepage Hero Banner content type and add the earlier elements back alongside Personalization Persona. Make them all optional:
| Name | Element Type |
|---|---|
| Personalization Country/Region | Select Box [Locations] |
| Personalization Postal Code | Plain Text (200) |
| Personalization Persona | Select Box [Personas] |
| Personalization Topic | Select Box [Topics] |
Then update the text/personalized-hero content layout to output each attribute only when it's been filled in:
<div data-variant="{{publish element="Personalization Variant Name"}}"
data-codes="{{selectedValues element="Personalization Country/Region"}},{{publish element="Personalization Postal Code"}},{{selectedValues element="Personalization Persona"}},{{selectedValues element="Personalization Topic"}}"
{{#ifSet element="Personalization Country/Region"}}data-geo="{{selectedValues element="Personalization Country/Region"}}"{{/ifSet}}
{{#ifSet element="Personalization Postal Code"}}data-postal-code="{{publish element="Personalization Postal Code"}}"{{/ifSet}}
{{#ifSet element="Personalization Persona"}}data-persona="{{selectedValues element="Personalization Persona"}}"{{/ifSet}}
{{#ifSet element="Personalization Topic"}}data-topic="{{selectedValues element="Personalization Topic"}}"{{/ifSet}}
hidden>
…
</div>
The ifSet checks matter: an empty attribute such as data-persona="" counts as a dimension that doesn't match, so the variant would never be shown.
Because data-codes now carries the codes from every dimension, watch out for codes that mean different things in different dimensions. For example, the persona code PT (Parent / supporter) is also Portugal's country code, so with Personalize by set to Geo, that variant would show to visitors in Portugal. Choosing persona and topic codes that don't clash with country codes avoids this.
Finally, set Personalize by to "Combined" on your Personalized Hero content and fill in the dimensions each Hero Banner should target. Make sure one of them targets Rest of world or Everyone else as the fallback.
Adjusting weights (optional)
To let editors change the dimension weights, add an optional element to the Personalized Hero content type:
| Name | Description | Element Type | Size |
|---|---|---|---|
| Combined Priority | Optional. Overrides the dimension weights when Personalize by is Combined, e.g. topic:3,geo:2,persona:1 |
Plain Text | 100 |
Then output it on the wrapper in the text/html layout:
{{#ifSet element="Combined Priority"}}data-priority="{{publish element="Combined Priority"}}"{{/ifSet}}
What's next?
Lastly, we'll take a look at how to Test and Troubleshoot the Personalization Engine.
Back to top