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

# Create a web popup template

> Build a web popup from blocks, then select the saved template in a campaign or user journey.

## Overview

Build a web popup by arranging blocks in Notifly's visual editor.

## Minimum SDK versions

To display a popup built with this editor, your site needs Notifly's JavaScript SDK **2.12.0** or later.

> [!NOTE]
>
> Personalized text requires JavaScript SDK **2.21.0** or later. Older SDK versions don't display personalized popups. Popups without personalization still use the minimum version listed above.

## Create a template

In the sidebar, go to **Message Templates > Web Popup Templates**.

![Web popup template list](https://mintcdn.com/notifly/BljWoGqDT6exoK9p/images/i18n/en/web-message/webpopup-new.png?fit=max\&auto=format\&n=BljWoGqDT6exoK9p\&q=85\&s=b3ee10e16de2d06dd2445d187bf0537b)

If you’re using the legacy editor, click **Use latest editor**. Then click **Create New Template**.

![Template creation dialog](https://mintcdn.com/notifly/0_mniRtlC78csfem/images/i18n/en/in-app-message/popup-new.png?fit=max\&auto=format\&n=0_mniRtlC78csfem\&q=85\&s=173217abe3992b04ce6fd60ebb3b8337)

Choose a layout, or select **Start from scratch** to build the template from a blank canvas.

## Editor layout

![Editor with the toolbar, block panel, canvas, and settings panel](https://mintcdn.com/notifly/BljWoGqDT6exoK9p/images/i18n/en/web-message/webpopup-editor.png?fit=max\&auto=format\&n=BljWoGqDT6exoK9p\&q=85\&s=f2e5c63cdfe601a1919f2fbe3c804e22)

The **top toolbar** has a template name field and controls to undo, redo, preview, and save.

Use the **left panel** to add a block. Image, Text, Button, Divider, Spacer, and HTML add content. Row lays out columns. Carousel and Indicator work with slides.

The **canvas** shows the popup as you edit. Use the device and resolution menus at the top to see how it looks at different screen sizes, including mobile, tablet, and desktop.

The **right panel** shows the style settings for the selected block. When you clear the selection, the panel shows settings for the entire popup.

## **Add a block**

Select a block in the left panel to add it to the canvas. Click it on the canvas to show its blue outline and toolbar.

![Toolbar for a selected block](https://mintcdn.com/notifly/0_mniRtlC78csfem/images/i18n/en/in-app-message/toolbar.png?fit=max\&auto=format\&n=0_mniRtlC78csfem\&q=85\&s=d25126c0261171eed65e3ac61fed4850)

* Use **Move up** or **Move down** to reorder the block.
* Use **Duplicate block** to make a copy with the same settings.
* Use **Delete block** to remove it.

![Block selected on the canvas](https://mintcdn.com/notifly/0_mniRtlC78csfem/images/i18n/en/in-app-message/block.png?fit=max\&auto=format\&n=0_mniRtlC78csfem\&q=85\&s=39b75b1994d7b53e52cd7663e6224fe0)

### **Content blocks**

Add an **Image** block, then upload the image in the right panel. Set the width as a percentage. For height, choose automatic sizing or set an aspect ratio. You can also set the corner radius, margin, click action, and alternative text.

Image URLs and click actions in Image blocks don't accept personalization variables.

Enter the text for a **Text** block in the right panel. Set the font, size, line height, weight, color, and alignment for the block. To format part of the text, select it and use the bold, italic, underline, or color controls.

To insert a user's name or event data, add a personalization variable.

1. Select the **Text** block and place the cursor in **Text content** where you want to insert the variable.
2. Click **Personalization Variable** below the field.
3. Set the **Variable Type** and **Variable Name**. Under **Default Value (Optional)**, enter what to show when the variable has no value.
4. Click **Paste** to insert the Liquid expression at the cursor.

![Personalization settings showing the name property and its default value in Korean](https://mintcdn.com/notifly/0_mniRtlC78csfem/images/i18n/en/in-app-message/variable-input.png?fit=max\&auto=format\&n=0_mniRtlC78csfem\&q=85\&s=87eebebf2ccd6731583022eb198d4b15)

For example, choose **User** as the variable type and enter `name` as the variable name. Enter `there` as the default value to show "Hi there!" if the user's name is missing. The screenshot uses the Korean fallback `고객` (customer).

```liquid theme={null}
Hi {{ user["name"] | default: "there" }}!
```

![Text block with a personalization variable. The canvas shows the Liquid expression before substitution.](https://mintcdn.com/notifly/0_mniRtlC78csfem/images/i18n/en/in-app-message/text-example.png?fit=max\&auto=format\&n=0_mniRtlC78csfem\&q=85\&s=3f817cf6fbb315734aa0e87483d6db27)

You can also enter Liquid directly. See [Message personalization basics](https://docs.notifly.tech/en/user-guide/campaigns/personalization/basic.md) for supported data and syntax.

Add a **Button** block and set its label, background color and opacity, corner radius, border, font style, text color, alignment, and padding. The default click action is **Close**. Choose **Open link** to open a URL or deep link.

To personalize the button text, choose **Personalization Variable** in **Content > Label**. To personalize a URL or deep link, choose **Open link** under **Click action** and use **Personalization Variable** in the **Link** field.

Use a **Divider** block to add a line between sections.

Use a **Spacer** block to add space between blocks.

Use an **HTML** block for content that needs custom HTML and CSS. From an HTML element's event handler, you can call `notiflyPopup` methods to close the popup, open a link, or control a carousel.

Click **Personalization Variable** in the HTML field to insert a variable. Enter Liquid directly to write conditions or loops, read from [a catalog](https://docs.notifly.tech/en/user-guide/catalogs/guide.md), or use [Connected Content or `abort_message`](https://docs.notifly.tech/en/user-guide/campaigns/personalization/advanced). When `abort_message` runs, the popup doesn't appear.

#### Call `notiflyPopup` methods

Call methods from the `onclick` attribute of an HTML element, as shown below.

```html theme={null}
<button onclick="notiflyPopup.openUrl('https://example.com')">
  Learn more
</button>

<button onclick="notiflyPopup.hideForDays(7)">
  Hide for 7 days
</button>
```

| Method | Description |
| - | - |
| `notiflyPopup.close()` | Closes the popup. |
| `notiflyPopup.hideForDays(days)` | Closes the popup and hides it for the specified number of days. |
| `notiflyPopup.hideForever()` | Closes the popup and prevents it from appearing again. |
| `notiflyPopup.openUrl(url, options?)` | Opens a URL. Web popups ignore the `openMode` option passed in HTML. If your JavaScript SDK supports opening links in a new tab, the popup uses the same mode for every URL action. If any URL action in the editor is set to open in a new tab, this method also opens links in a new tab. Otherwise, it opens links in the current tab. |
| `notiflyPopup.openDeepLink(url)` | Opens the specified deep link. |
| `notiflyPopup.nextSlide()` | Moves to the next slide in the carousel. |
| `notiflyPopup.prevSlide()` | Moves to the previous slide in the carousel. |
| `notiflyPopup.goToSlide(index)` | Moves to the slide at `index`. The first slide has index `0`. |

#### Collect web push consent

A web popup button can save the user's consent and ask the browser to allow notifications in one click. The popup closes before the user responds to the browser prompt. Visitors can use the button without signing in.

You need **JavaScript SDK 2.22.0 or later** and web push setup on your site. On unsupported SDK versions, the consent button is disabled.

1. In the web popup editor, select the **Button** block that you want to use to collect consent.

2. Under **Click action** in the right panel, select **Web push consent**. This action is available only on web popup buttons.

   ![Web push consent action with the JavaScript SDK 2.22.0 minimum version notice](https://mintcdn.com/notifly/BljWoGqDT6exoK9p/images/i18n/en/web-message/editor-action.png?fit=max\&auto=format\&n=BljWoGqDT6exoK9p\&q=85\&s=65d5fad8ed57fa73e4b3dc27ced8a28d)

3. In the button label and the popup text, explain what notifications the user will receive. Save the template and select it in a campaign.

4. Run the campaign for test users only. Use a browser where notification permission is still undecided for your site. Trigger the popup and click the consent button. Check the test user's saved consent and verify that the browser receives the permission request. **Preview** only logs the click action.

> [!NOTE]
>
> To request permission only through the web popup, turn off **Auto Display** in **Settings > SDK Settings > Website Settings > Permission Prompt Settings**. For integration requirements, see the [JavaScript SDK guide](https://docs.notifly.tech/en/developer-guide/javascript-sdk.md#collect-consent-with-a-web-popup-button).

**User properties saved**

| Property | Meaning | Value recorded on click |
| - | - | - |
| `$web_push_consent` | Whether the user explicitly agreed to receive web push | `true` |
| `$web_push_consented_at` | When the user agreed to receive web push | UTC ISO 8601 string, for example `2026-01-01T09:00:00.000Z` |

The consent timestamp comes from the browser where the user clicked the button. If the user gives consent again in a newly displayed popup, Notifly updates the timestamp to the new click time. Users who have never consented may have neither value.

These are reserved Notifly properties. You can't create or delete them, or mark them for encryption, in general user property settings. View the saved values in the user's details.

**What happens when the user clicks**

Notifly sends the permission request straight to the browser without showing its default permission prompt, then closes the web popup.

| Browser permission state or outcome | Behavior |
| - | - |
| The user hasn't decided yet | Notifly asks the browser for notification permission. Whether the browser actually shows the prompt depends on its policy. |
| The user allows notifications or has already allowed them | Notifly registers a push subscription while the popup is closed. If permission was already granted, the browser does not prompt again. |
| The user denies permission or has already blocked notifications | The web popup stays closed. If notifications are already blocked, Notifly doesn't ask again. The user must grant permission in their browser settings. |
| The user closes the browser prompt | The popup stays closed and no push subscription is registered. |
| The user's environment isn't supported, web push isn't set up, or an error occurs | The popup closes without showing the outcome. Check your site's web push configuration and supported environments before launching the campaign. |

> [!WARNING]
>
> **Consent and browser notification permission are separate.** If the user denies or dismisses the browser prompt, the saved consent remains. To receive notifications, the user needs browser permission and an active push subscription, even if `$web_push_consent` is `true`.

To let users withdraw consent, add a setting on your site or in your service that updates the consent property. Exclude users who withdraw consent from the campaign audience. See [Manage consent and browser permission](https://docs.notifly.tech/en/user-guide/channel/web-push-notification/guide.md#4-3-manage-consent-and-browser-permission).

#### Identify which button a user clicked

In the **Button** block settings, enter a name in the field marked `button_name`. Notifly includes the name in the click event. Give each button a different name if you want to track clicks separately.

| Example button name | Button action | Event | Event parameters |
| - | - | - | - |
| `coupon_cta` | Open a URL or deep link | `notifly__main_button_click` | `button_name = coupon_cta`, `campaign_id = aB3dE7` |
| `consent_cta` | Web push consent | `notifly__main_button_click` | `button_name = consent_cta`, `campaign_id = aB3dE7` |
| `close_popup` | Close | `notifly__close_button_click` | `button_name = close_popup`, `campaign_id = aB3dE7` |
| `dismiss_today` | Do not show again or Hide for N days | `notifly__close_button_click` | `button_name = dismiss_today`, `campaign_id = aB3dE7` |

### **Layout blocks**

A **Row** block puts two to four columns side by side. Set the width of each column as a proportion of the row, then set vertical alignment and block spacing. You can also set the background color, opacity, and outer margin. Add blocks such as **Image**, **Text**, or **Button** to each column.

### **Carousel blocks**

Add a **Carousel** to display slides. Each popup can contain one carousel. Select the carousel to open its settings in the right panel.

* **Slide management**. Add a slide or select an existing one to reorder, duplicate, or delete it.
* **Slide transition**. Choose an animation (Slide, Fade, or None) and decide whether to allow swiping or looping.
* **Autoplay**. Turn on automatic slide transitions and set the time between slides.
* **Indicator**. Choose dots or a slide number. Set the position, offsets, size, and spacing. For dots, set the colors of the active and inactive dots. For a slide number, set the text and background colors.

Add an **Indicator** block to place the carousel indicator elsewhere in the popup.

## **Popup settings**

Click an empty part of the canvas or click **Popup** at the top of the right panel to edit the settings for the entire popup.

### **Popup type**

* **Dialog** appears in the center of the screen. This is the default.
* **Bottom Sheet** slides up from the bottom of the screen.
* **Full Screen** fills the screen.

### **Background**

Set the background color, opacity, or image of the popup content area.

### **Popup style**

Set the padding and block spacing. If the popup type supports it, set the maximum width and corner radius in pixels. Switch to individual inputs to set a different radius for each corner or different padding for each side.

### **Overlay**

For a dialog or bottom sheet, set the overlay color and opacity. Turn on **Close on click** to close the popup when the user clicks the overlay.

### **Animation**

Set **Enter animation** and **Exit animation** separately. For each, choose **None**, **Fade**, **Slide Up**, **Slide Down**, **Slide Left**, or **Slide Right**.

### **Close button**

Choose whether to show the close (X) button. Set the corner (top left or top right), placement (inside or outside the popup), size in pixels, stroke weight, icon color, and horizontal and vertical offsets.

## **Save and use the template**

Click **Save** in the toolbar. To use a template from **Web Popup Templates**, select it when you set up a campaign or user journey.

When you save a template containing personalization variables, Notifly enables personalization automatically. When the popup appears, Notifly fills in the variables with user or event data.

> [!NOTE]
>
> **Preview** shows the Liquid expression before Notifly fills in the actual values. To test what users will see, run a campaign for test users only. Trigger the configured event on a website that uses a supported SDK version.

## **FAQ**

> [accordion] Does changing the popup type reset my settings?
>
> Blocks and their content stay in place. Some style settings may reset, depending on the new type. Choose a type before editing the individual styles.

> [accordion] How many slides can I add to a carousel?
>
> There is no slide limit. Use about three to five slides so users can browse them easily.

> [accordion] Can I add a font?
>
> At the bottom of the font list, click **Add font**. In Google Fonts, select a font and click **Get font**, then **Get embed code**. Copy the URL that starts with `https://fonts.googleapis.com/` and paste it into **Webfont URL**. In **Font name**, enter the exact name shown in Google Fonts. Click **Load font**, then **Add**.


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