> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pureclarity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a message

> Build an on-site message: its content, who sees it, when it opens, how often, and publishing it

Go to **On-site messages**, click **New message**, and pick a [template](https://docs.pureclarity.com/features/on-site-messages/templates.md) or **Start from scratch**. The editor has three tabs: **Content**, **Audience & trigger** and **Measure**. The preview beside them updates as you type.

A new message is a draft. Click **Save** at any time; visitors don't see it until you click **Publish**.

## Content

### Format

Choose a format: **Popup**, **Bottom sheet**, **Slide-in**, **Bar** or **Teaser tab**. Bars go at the top or bottom of the page. Slide-ins and teaser tabs go on the left or right.

On a phone, a popup opens as a bottom sheet collapsed to a small part of the screen, so the visitor can keep using the page. It expands into the full popup when they tap or swipe it. While collapsed it shows the **Line shown before it's expanded on phones**, such as "Tap to unlock 10% off". A teaser tab shows its **Tab text**.

Every message also needs a **Description for screen readers**, such as "10% off your first order". It's read out when the message opens.

### Blocks

A message is built from blocks, shown from top to bottom. Click **Add** to add one, and use the arrows to reorder them. A message can have up to 12 blocks.

| Block | What it shows |
| - | - |
| **Heading** | A short heading. |
| **Text** | Plain text. Leave a blank line to start a new paragraph. |
| **Image** | An image from its address, such as one in your image library. Describe it for visitors who can't see it, or mark it as decorative. |
| **Button** | A link, as a filled or outlined button. |
| **Discount code** | A code visitors can copy. Create the code in your store first. |
| **Free delivery progress** | Progress toward an amount the basket must reach, such as free delivery. Write `{remaining}` in its text to show how much more to spend. It updates as the visitor adds to their basket. |
| **Products** | 1 to 4 product cards: either products PureClarity recommends for this visitor on this page, or what's in their basket, most recently added first. If there are none, the message isn't shown. |
| **Countdown** | Time left until an end date and time, in your time zone. The message closes when it reaches zero and isn't shown after then. |
| **Question** | One question with 2 to 6 answers, and a thank-you line shown once the visitor answers. One per message. |

Text is shown exactly as you type it; it can't contain HTML.

With a **Favourite category or brand** rule on the Audience & trigger tab, write `{category}` or `{brand}` in any text to name it, such as "Love {brand}?". A message whose category or brand name can't be found isn't shown.

### Colours and font

Messages don't pick up your theme's styles. Set the background, text, button and button text colours, and a font, to match your store. If text would be hard to read on its background, the editor says so and you can't publish until you change it.

## Audience & trigger

### Who sees it

Every rule you set must match for the message to show. Rules you leave empty don't restrict it.

| Rule | Matches visitors… |
| - | - |
| **Segment** | in a [segment](https://docs.pureclarity.com/features/segments/overview.md), or everyone. |
| **Pages** | on any of the page types you choose, such as product or basket pages. |
| **Address** | on a page whose address contains, is, or starts with what you enter (**Only on addresses that**), and not on one you exclude (**Never on addresses that**). |
| **Devices** | on desktop, mobile or tablet. |
| **Visitors** | on their first visit, or who have visited before. |
| **Where they came from** | who arrived with the `utm_source`, `utm_medium` or `utm_campaign` you enter, or from a site whose address contains any you list, such as `google` or `facebook`. |
| **Basket** total | whose basket is at least, or below, an amount in your base currency. You can set different amounts for other currencies. |
| **Basket** contents | whose basket holds any of the products, categories or brands you choose. |
| **Left a basket in the last (days)** | who left a basket on an earlier visit, in the last 1 to 30 days, and haven't bought since. |
| **Favourite category or brand** | whose favourite category or brand (the one they've viewed products in during the most visits) is one you choose, or any. By default they must have viewed it in at least 2 visits. |

To show a message only between two dates, set **Starts** and **Ends** under **Dates**.

### When it opens

Add one or more triggers. The message opens when any of them happens.

| Trigger | Opens the message… |
| - | - |
| **After a delay** | after 0 to 600 seconds on the page. |
| **On scroll** | when the visitor scrolls 1% to 100% down the page. |
| **After a number of pages** | from the page number you choose, 1 to 20, onwards: set 3 and it can open on the 3rd page they view in the visit or any page after. |
| **When idle** | after 5 to 600 seconds without the visitor scrolling, typing, tapping or moving the pointer. |
| **Exit intent** | when the visitor goes to leave: on desktop, when the pointer leaves the top of the page; on a phone or tablet, when they quickly scroll back up, as they do to reach the address bar. |
| **Add to cart** | when the visitor adds something to their basket. |
| **On a click** | when the visitor clicks an element on your page matching the CSS selector you enter under **Element clicked**. |
| **Custom event** | when your site's own code sends the event, for example `window.dispatchEvent(new CustomEvent('pureclarity:quiz_done'))` for an event named `quiz_done`. |

A popup that opens within 5 seconds covers the page before visitors have had a chance to look. The editor warns you about it, but you can still publish.

### How often

| Choice | The message shows… |
| - | - |
| **Once per visit** | at most once per visit. This is the default. |
| **On every page** | on every page the visitor views. |
| **Once every few days** | at most once in the number of days you set. |
| **Only once** | once per visitor, ever. |

**After it's closed, wait (days)** stops the message showing to a visitor for that many days after they close it. It's 7 days by default.

Whatever you choose, a visitor sees at most one message at a time, and at most the number set under **Messages per visit** in a visit. See [How messages take turns](https://docs.pureclarity.com/features/on-site-messages/overview.md#how-messages-take-turns).

## Measure

Some visitors who would see the message are picked at random and never shown it: the holdout. Set the share under **Visitors held out (%)**: 10% is the default, and you can set 0% to 50%. See [Read the results](https://docs.pureclarity.com/features/on-site-messages/results.md).

## Preview and test

Switch the preview between **Desktop** and **Phone**, or expand it. On the phone preview, tap or swipe up on a popup to expand it as a visitor would.

To see a saved message on your real store, click **Preview on my store**. This opens your store with the [debug toolbar](https://docs.pureclarity.com/support/general/debug-toolbar.md): log in to it, then under **Zones**, **Messages**, click **Preview** beside the message. It shows the last saved version, even before it's published, and isn't counted as a view.

## Publish

Click **Publish**. If anything needs fixing, a banner lists each problem; click one to go to it. A message can't be published while it has:

* placeholder text in square brackets, such as `[Your offer]`
* no blocks, or no trigger
* an image with no description that isn't marked as decorative
* colours that make its text, buttons or progress bar hard to read
* a progress block with no amount, or a countdown with no end
* a segment that has since been deleted

The editor also warns, without stopping you, about a popup or bottom sheet that opens within 5 seconds, a bottom sheet shown on every page (a popup opens at most once per visit whatever you choose), a countdown whose end has passed, a progress block without `{remaining}`, and a 0% holdout.

## After publishing

Your messages are listed on the **On-site messages** page with their status (Draft, Live, Scheduled, Paused or Ended), how often they've been shown and their results. From the list you can **Pause** a live message, **Resume** a paused one, and from its menu **Duplicate** it as a new draft or **Delete** it. Click a message's name to edit it.

Changing a live message's content, format, colours, triggers or holdout starts a new set of results, so results never mix two versions. Changing its name, audience, how often it shows or its dates doesn't.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.