Skip to main content

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​

  1. 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.
  2. An interaction set to run in that slot holds the content: its journeys decide who sees what, just as they do on page views.
  3. 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.

  1. Click the underlined part of the heading to open the Runs on drawer.
  2. Under Trigger, choose Template slot.
  3. 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.
  4. 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​

FeatureOn page viewsIn a template slot
ActionsAll action typesTemplate, Component, and Frequency cap only
PlacementEach action picks a CSS selectorActions render inside the slot, in order. Switching to a slot removes their CSS selectors.
JourneysChecked on every page viewChecked when the slot's template renders, with the same conditions
MetersCount the page viewNot counted, and the Meters tool is hidden
Frequency capsCounted when the journey matchesCounted only once the content is on the visitor's screen. Caps must count per visitor.
Potential reachAvailableNot available; the estimate is based on page views
PriorityDecides which page interactions show togetherDecides 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.footer fills 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.