StoreSpan
Injectables

Top bar

A message bar across the top of your storefront, with messages that can turn one after another, variables filled in for each shopper, per-country text, and the option to move your theme's header out of the way.

A Top bar is a thin bar of promotional text across the very top of your storefront — a free-shipping line, a sale countdown, a welcome message. You can show one message or several that can turn one after another, colour the bar to match your store, and change the wording for each shopper with variables.

Choose Top bar from the Content type list in the Content card. A new top bar starts at the top of the page with one message and your store's dark default colours; change everything from there.

Pinned or inline

Choose how the bar sits on the page.

  • Pinned (the default) keeps the bar at the very top of the screen while the shopper scrolls, so the message is always in view. Your theme's own header is moved down so the bar does not cover it (see Move your theme's header).
  • Inline places the bar in the page at the spot you chose and lets it scroll away with the rest of the page.

Either way the bar reserves its own space, so the page loads in its final position with no jump as the bar appears.

One pinned bar at a time. A page can show only one pinned top bar; two pinned bars would sit on top of each other. If more than one pinned top bar could land on the same page, use a targeting rule or an exclusive group so only one shows.

Messages

Each message has:

  • Message — the words of the message. One line, up to 300 characters. It may include variables.
  • A link (optional). Leave Link words empty and the whole message becomes the link; fill it in and a separate link or button appears after the message. A link can be shown as an underlined link or a filled button, and can open in the same tab or a new one. The link address may be up to 2,048 characters and the link words up to 60. The link words may include variables too; the link address may not.
  • Countries — which shoppers this message shows to (see Show a message only in some countries).

You can add up to 6 messages. Move them up and down to set their order; remove the ones you do not want.

Messages that turn

With two or more messages the bar can turn from one to the next on its own. A new bar does not: it stays on the first message a shopper can see. To make it turn, switch on Turn between messages on its own under Turning between messages. You control:

  • How long each message shows — 2 to 60 seconds (6 by default), while the bar turns on its own.
  • The effect — a soft fade or a sideways slide.
  • Show previous and next buttons (optional) — small buttons on the bar that move between the messages, whether or not the bar turns on its own. While it does, a pause button appears next to them.

Turning pauses while the shopper's pointer is over the bar or their keyboard focus is inside it, and while the browser tab is in the background, so a message is never missed mid-read. A shopper who has asked their browser to reduce motion sees the first message and no automatic turning; the previous, next and pause buttons still work for them.

Variables

A variable is a {{ }} token you type into a message that is filled in on the storefront, for each shopper, when the page loads. Write Free shipping to {{ geo.countryName | "your country" }} and a shopper in Canada sees "Free shipping to Canada".

The variables are the same ones the Template content type offers — country, region, cart total, product, page type, visitor type and more. See the full list in Content types. The Insert variable menu beside Message and beside Link words drops one at the cursor.

A worked cart example:

You have {{ cart.itemCount }} items in your cart

And a message that changes with the cart total:

{{#if cart.total gte 100}}You have free shipping!{{else}}Spend $100 for free shipping{{/if}}

A few rules to know:

  • Values are filled for each shopper, on the storefront — not when you save. The dashboard preview fills them from the simulator (see In the preview).
  • A value is always shown as plain text. If a variable holds something that looks like HTML, it appears as written and cannot change the page.
  • A link address cannot contain a variable — only the message and the link words can. The dashboard will not let you save a link address with a {{ … }} in it.
  • When a value is not known (for example the shopper's country cannot be read), the variable falls back to the word or phrase you put after the |, like "your country" above. With no fallback, an unknown value simply shows nothing.

Show a message only in some countries

Each message has the setting Show this message to:

  • Everyone — every shopper sees it.
  • Only these countries — only shoppers in the countries you choose. A shopper whose country cannot be read does not see the message.
  • Everyone except these countries — everyone but the countries you choose. A shopper whose country cannot be read does see the message.

Tick the countries in the list. Type in the field above the list to find a country by its name, by its two-letter code, or by an everyday short name such as UK or USA. A message can name as many countries as you like.

Paste a list of countries

If you already have a list, press Paste a list and paste it. Country names and two-letter codes both work, separated by commas or new lines — for example Germany, France, IT, ES. StoreSpan adds the ones it knows and tells you which entries it could not find.

Groups of countries

Under Groups of countries you can choose the European Union as one entry in place of its 27 countries. It is marked as a group, so you can tell it from a country. Pasting EU chooses it too.

  • A group counts all of its countries. To leave one of them out, choose the countries one by one instead.
  • The European Union is its 27 member countries only. The United Kingdom, Norway and Switzerland are not in it; choose them as countries when you need them.
  • Whatever you add the group to — a message, a targeting rule or a menu item — remembers the group, not a copy of its countries. If the European Union gains or loses a member, StoreSpan updates the group in a release, and what you have published follows without an edit.
  • You can mix a group with single countries, for example the European Union and Norway.

One bar, a different message for each region

This setting is per message, so one bar can carry a message for the United States, one for the United Kingdom, one for the European Union, one for Australia, and one for everybody else: give the last one Everyone except these countries and choose the United States, the United Kingdom, the European Union and Australia. Each shopper then sees only the message for their region. A shopper who matches just one of your messages sees that one message: the bar does not turn for them, and the previous, next and pause buttons are not shown. If every message is limited by country and a shopper matches none of them, the bar is not shown to that shopper at all. To avoid that, keep one message for everybody else, as in the example above.

The setting works on top of any rule on the injectable. To show or hide the whole bar by country, use a Geo / country condition instead — see Targeting, schedule and frequency cap.

If a message's own text already has several {{#if}} blocks inside one another, it may be too deep to limit by country as well; the editor tells you when you save.

Look

The Colours section sets the bar's background, text, link, button and border colours. Each can be one of your store design colours or a colour you pick just for this bar. If your chosen text colour is hard to read on your background, the editor warns you.

Other sections cover:

  • Position and size — alignment, padding, least height, the gap between text and buttons, and the content width (full width, or held to a fixed width and centred).
  • Text — size, line height, weight, letter spacing, and whether the text is upper-case.
  • Border and shadow — an optional bottom border and a soft drop shadow.
  • Small screens — a screen width below which the bar can use a smaller text size, tighter padding, or be hidden altogether. Anything you leave unset stays the same as the desktop bar.

Close button

Turn on the close button to give shoppers an × to dismiss the bar, and set its label. How long the bar stays gone after a shopper closes it is the Snooze after a dismissal setting in the Frequency cap card — see Targeting, schedule and frequency cap. Like all frequency caps, the snooze is kept in the shopper's own browser and is best effort.

Move your theme's header

When the bar is Pinned, it sits at the very top of the screen, over anything your theme fixes there — a sticky header or navigation bar. So the bar does not cover it, StoreSpan can move that header down by the bar's height and put it back if the bar is removed. This runs on the storefront only.

Three choices:

  • Find it for me (the default) looks for whatever your theme sticks to the top of the page and moves it down. It leaves tall menus, drawers and pop-over panels alone, and follows your theme if it makes a header sticky only after the shopper scrolls.
  • Only these selectors moves just the elements whose CSS selectors you list, and looks for nothing else. Use this when Find it for me misses your header or moves the wrong thing.
  • Off moves nothing.

You can also give a skip list of selectors that must never be moved.

For your theme's developer

Selectors are ordinary CSS selectors (the child combinator > is allowed), up to 500 characters per list. They may not contain <, {, } or ;. To protect one element without a skip list, add the attribute data-ss-topbar-ignore to it in your theme — the move always leaves that element, and everything inside it, alone.

Honest limits worth knowing:

  • Only headers that stick to the top are moved. A header that scrolls away with the page is left alone — and does not need moving, because the bar already reserves its own space and the page flows below it.
  • A header taller than half the screen is left alone — StoreSpan treats it as a drawer or overlay, not a header.
  • On a very old browser that cannot watch the page for changes, the move is skipped. The bar still shows and still reserves its space.
  • An address that is not a valid selector is ignored.

In the preview and on the storefront

The dashboard preview shows the finished bar with your colours and layout, and fills variables from the simulator — change the country in the simulator and a {{ geo.countryName }} message and your per-country messages change with it.

Two things run on the storefront only and are not shown in the preview: messages turning from one to the next, and moving your theme's header. The preview says so on the panel.

On this page