Template Slots
A template slot is a named spot inside a template that another interaction fills. Use one when a template is already on the page, such as an account page or a newsletter preferences screen, and you want to target something inside it: an upgrade offer for one plan, a renewal reminder for another, and nothing for everyone else.
The template marks the spot, and slot interactions compete to fill it. Each slot shows at most one interaction at a time.
How It Works
- A template declares a slot in its HTML with
<allegro-slot name="account.footer"></allegro-slot>. Whatever the template puts inside the element shows until an interaction fills the slot, and stays if none does. - An interaction set to run in that slot holds the content: its journeys decide who sees what, just as they do on page views.
- When the template renders on a page, Allegro checks every published interaction set to that slot and fills it with the winner.
Developers write the slot into the template; see Template Slots in the developer guide for the markup.
Run an Interaction in a Slot
Every interaction's builder heading says what it runs on, such as Journeys on page views. The underlined part is a button.
- Click the underlined part of the heading to open the Runs on drawer.
- Under Trigger, choose Template slot.
- Under Slot, pick the slot to fill. Slots are listed by the template that declares them, with how many other interactions already fill each one.
- Click Save, then save the interaction.
The heading now reads Journeys in followed by the slot name. Open the drawer again to move the interaction to another slot or back to page views. The slot is set for the whole interaction, not per journey.
Only slots in published templates are listed. If a template stops declaring a slot that an interaction still uses, the drawer flags it with No published template declares this slot; the interaction keeps it until you pick another.
What Changes in a Slot
| Feature | On page views | In a template slot |
|---|---|---|
| Actions | All action types | Template, Component, and Frequency cap only |
| Placement | Each action picks a CSS selector | Actions render inside the slot, in order. Switching to a slot removes their CSS selectors. |
| Journeys | Checked on every page view | Checked when the slot's template renders, with the same conditions |
| Meters | Count the page view | Not counted, and the Meters tool is hidden |
| Frequency caps | Counted when the journey matches | Counted only once the content is on the visitor's screen. Caps must count per visitor. |
| Potential reach | Available | Not available; the estimate is based on page views |
| Priority | Decides which page interactions show together | Decides which interaction fills each slot |
Evaluate and the Assistant work the same way in both.
Which Interaction Fills a Slot
When several interactions match the same slot, the one ranked highest in the Priority list fills it. Interactions that aren't ranked come after ranked ones, oldest first. An interaction that matches but has no actions for the visitor doesn't count, so the next one gets the slot.
Slot interactions and page view interactions never hide each other, and Conflicts don't apply to slot interactions.
Things to Know
- A template can declare several slots, and the same slot name can appear in
more than one template. An interaction set to
account.footerfills that slot in every template that declares it. - Slots inside a template embedded with
<allegro-template>are filled when the embedded template loads. - A slot interaction never runs on page views. To show the same content on a page too, use a separate interaction.
Related
- Templates — the content blocks that declare slots
- Journeys — targeting a slot's content
- Priority — ranking interactions that fill the same slot
- Template Slots for developers