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

# Embed settings

> Every option of the Embed code screen, with its key in embedSettings and its attribute on the widgetic tag

Every composition has the same list of embed settings: how the widget fits its place, where it appears and when. This page lists all of them. Each one has three names:

* **Setting** is the label in the **Embed code** screen of the dashboard.
* **Key** is the name in the `embedSettings` of the composition. You read and save it with [the API](https://docs.widgetic.com/docs/api/embedding.md#set-the-options-with-the-api) or, from an assistant, with the [embed settings tools](https://docs.widgetic.com/docs/agents/tools.md#embed-settings).
* **Attribute** is where it ends up on the `<widgetic>` tag in your page. An attribute you write by hand works the same as one the dashboard wrote. A setting can have no attribute, or two.

The list is the schema that `GET /compositions/{id}/schema/embed` returns, the one the dashboard draws, so a form of your own can be drawn from it. For what the settings do together, with examples, see [Embedding widgets](https://docs.widgetic.com/docs/api/embedding.md).

## Which settings apply

The dashboard shows a setting only when it can matter, and leaves the settings it hides out of the code. The schema says when with each setting's `visibilityCondition`.

| When you choose | You also get |
| - | - |
| **Use iframe** on | **Width** and **Height**. Everything else needs the script, so it is hidden. |
| **Use iframe** off | **Resize mode**, **Autoscale** and the rest. |
| Resize mode `fixed` or `custom` | **Width** |
| Resize mode `responsive` | **Adaptive width** |
| Embed target `overlay` | **Overlay position**, **Add background**, the **Triggers**, **Excludes**, **Visitors**, **Schedule** and **Acquisition** settings |
| Embed target `mixed` | **Overlay position**, **Exclude URLs** and **Keep dimensions**. With Keep dimensions off: **Overlay resize mode**, and **Overlay width** and **Overlay height** for the modes that use them |
| **Add background** on | **Overlay color** |
| **Restrictions** on | **Max # of views**, **Time period**, **Display on mobile** and **Display on desktop** |

**Use iframe**, **Height**, **Embed target** and **Restrictions** are always shown.

## Basic options

How the box takes its place in the page.

| Setting | Key and attribute | Default | What it does |
| - | - | - | - |
| Use iframe | `useIframe` | Off | On: the code is a plain `<iframe>` of the composition's frame page, with no script. It is the simplest and safest code, but the widget cannot follow the height of its content or hear events from your page, so only Width and Height remain. Off: the code is the script and the `<widgetic>` tag, and every other setting applies. |
| Resize mode | `resizeMode` → `resize` | `fillWidth` | How the box takes its width. `fillWidth` (`fill-width`): as wide as the space the tag is in. `fixed`: the width and height of the tag, never wider than its space. `responsive`: as wide as its space, up to the Width. `custom`: the same box as `fixed`. A tag with no `resize`, or with any other value, is a fixed box. |
| Width | `width` | 800, from 50 to 4096 | Pixels. With `responsive` it is the widest the box gets. A tag that gives no width is 400 pixels wide. |
| Height | `height` | 600, from 50 to 4096 | Pixels. With Autoscale on, it is where the box starts. A tag that gives no height is 300 pixels tall. |
| Adaptive width | `responsive` → `adaptive` | 480, from 0 to 4096 | The breakpoint, in pixels. While the window is this narrow or narrower, the tag carries `data-widgetic-mobile="true"`, and it sends `widgetic:adaptive` each time the window crosses the breakpoint. The box itself does not change. Written into every code. |
| Autoscale | `autoscale` | On | The box follows the height of the widget, so it never clips it or scrolls it. The code says `autoscale="on"` or `autoscale="off"`; `false`, `0` and `no` also mean off. |

> [!NOTE]
>
> The **Embed code** screen starts a composition that has saved nothing at 800 by 600. The schema that the API returns lists 405 by 300 as the default of **Width** and **Height**, so a form drawn from the schema starts there.

## Layout and overlay

Where the widget appears. These settings are in the **Layout & overlay** group of the screen.

| Setting | Key and attribute | Default | What it does |
| - | - | - | - |
| Embed target | `embedTarget` → `embed-target`, `overlay` | `overlay` | `site` (shown as **Inline**): the widget sits in the page, where the tag is. `overlay` (**Overlay**): a pop-up that a trigger opens, and the tag stays hidden until then. `mixed` (**Mixed**): the widget sits in the page, and floats in a box while it is scrolled out of view. The code also gets `overlay="enabled"` for Overlay and Mixed. A tag you write by hand with no `embed-target` is Inline. |
| Overlay position | `overlayPosition` → `overlay-position` | `center-center` | One of nine cells: `top-left`, `top-center`, `top-right`, `center-left`, `center-center`, `center-right`, `bottom-left`, `bottom-center`, `bottom-right`. The pop-up sits 20 pixels from the edges. Overlay and Mixed. |
| Add background | `addBackgroundColor` → `overlay-backdrop` | Off | A layer behind the pop-up that stops clicks from reaching the page. Off: the page behind the pop-up stays usable. Overlay only. |
| Overlay color | `overlayBackgroundColor` → `overlay-background-color`, `overlay-background-opacity` | `#000000` at 50% | The color of the layer. The opacity is saved beside the color as `overlayBackgroundColor_opacity`, a number from 0 to 1, and written as `overlay-background-opacity`. Shown when Add background is on. |
| Keep dimensions | `keepDimensions` → `keep-dimensions` | On | Mixed only. On: the floating box keeps the size the widget has in the page. Off: the floating box is sized by the three settings below. |
| Overlay resize mode | `overlayResizeMode` → `overlay-resize-mode` | `fillWidth` | How the floating box is sized, when Keep dimensions is off. `fillWidth`: 90% of the window's width. `fillHeight`: 90% of its height. `fixedSize`: Overlay width by Overlay height. `fixedHeight`: 90% of the width, Overlay height. `fixedWidth`: 90% of the height, Overlay width. `allowScaleDown`: up to Overlay width by Overlay height, smaller when the window is. `fill`: 90% of both. |
| Overlay width | `overlayWidth` → `overlay-width` | 405, from 50 to 4096 | Pixels. For `fixedSize`, `fixedWidth` and `allowScaleDown`. |
| Overlay height | `overlayHeight` → `overlay-height` | 300, from 50 to 4096 | Pixels. For `fixedSize`, `fixedHeight` and `allowScaleDown`. |

A pop-up is never larger than 90% of the window, whatever its size says.

## Triggers

What opens an Overlay pop-up by itself. Mixed has no trigger: its floating box appears when the widget scrolls out of view.

| Setting | Key and attribute | Default | What it does |
| - | - | - | - |
| Event triggers | `eventTriggers` → `event-trigger` | `exitIntent` | What opens the pop-up. The values are in the table below. A value the script does not know acts as `exitIntent`. |
| Delay | `triggerDelaySeconds` → `trigger-delay` | 3, from 0 to 86400 | Seconds. The tag carries milliseconds: 8 seconds is `trigger-delay="8000"`. For `delay`. |
| Scroll distance | `triggerScrollDistance` → `trigger-scroll-distance` | 100, from 1 to 100000 | Pixels scrolled down the page. For `scroll`. |
| Scroll percent | `triggerScrollPercent` → `trigger-scroll-percent` | 50, from 0 to 100 | Share of the page's height. For `scrollPercent`. |
| Page views | `triggerPageViews` → `trigger-page-views` | 3, from 1 to 1000 | How many times a page with this embed must load for the visitor, in this browser. For `timesShown`. |

The values of **Event triggers**:

| Value | In the tag | What opens the pop-up |
| - | - | - |
| `exitIntent` | `exit-intent` | The pointer leaves the window through the top. On a touch screen: the back button, a quick scroll up at the top of the page, or a switch to another tab. It also opens once the visitor has scrolled 100 pixels down. On a touch screen the script adds one entry to the page's history to notice the back button. |
| `pageLoad` | `page-load` | As soon as the page is ready. |
| `delay` | `delay` | After **Delay** seconds, counted from when the page is ready. It fires once: closing the pop-up does not bring it back on the timer. |
| `scroll` | `scroll` | When the visitor has scrolled **Scroll distance** pixels down. |
| `scrollPercent` | `scroll-percent` | When the visitor has scrolled **Scroll percent** of the page's height. |
| `manual` | `manual` | Never by itself. Your page opens it with `Widgetic.show("COMPOSITION_ID")`. |
| `timesShown` | `times-shown` | Once a page with this embed has loaded as many times as **Page views** says, counted in this browser, and on every load after that. |

## Excludes

Situations in which the pop-up must not open. Overlay only, except **Exclude URLs**, which Mixed has too.

| Setting | Key and attribute | Default | What it does |
| - | - | - | - |
| Exclude URLs | `excludeUrlPatterns` → `exclude-url-patterns` | Empty | Patterns separated by commas or new lines. The widget does not open on a page whose address, or whose path and query, matches one. A pattern without `*` matches anywhere in the address, ignoring case: `/checkout` matches `/checkout/step-2`. With `*` standing for any characters, the whole address or path has to match: `/blog/*`. |
| After close | `excludeAfterDismiss` → `exclude-after-dismiss` | Off | Once the visitor has closed the pop-up, do not open it again. Remembered in the visitor's browser. |
| After open | `excludeAfterInteract` → `exclude-after-interact` | Off | Once the pop-up has opened, do not open it again. Remembered in the visitor's browser. |

## Visitors

Who the pop-up is for. Overlay only.

| Setting | Key and attribute | Default | What it does |
| - | - | - | - |
| Visitor type | `visitorType` → `visitor-type` | `any` | `any`, `new` or `returning`. `new` is the first page a visitor loads on a site that runs the Widgetic script, in this browser. `returning` is every page load after that, a reload included. The browser remembers it in its own storage, so clearing the site's data makes the visitor new again, and a browser that keeps no storage counts as returning. |
| Time on page | `minTimeOnPageSeconds` → `min-time-on-page` | 0, from 0 to 3600 | Seconds the visitor must have been on the page before the pop-up may open. 0 turns the rule off. |
| Site page views | `minSitePageViews` → `min-site-page-views` | 0, from 0 to 1000 | Page loads, on your site, of any page that runs the script, before the pop-up may open. Counted in the visitor's browser. 0 turns the rule off. |

## Schedule

When the pop-up may open, by the visitor's own clock. Overlay only. Every empty setting is no limit.

| Setting | Key and attribute | Default | What it does |
| - | - | - | - |
| Start date | `scheduleStartDate` → `schedule-start-date` | Empty | The first day, as `YYYY-MM-DD`. |
| End date | `scheduleEndDate` → `schedule-end-date` | Empty | The last day, as `YYYY-MM-DD`. The whole day counts. |
| Weekdays | `scheduleDaysOfWeek` → `schedule-days` | Empty | Names or numbers separated by commas: `mon,wed,fri` or `1,3,5`, where 0 is Sunday. Empty means every day. |
| From time | `scheduleTimeStart` → `schedule-time-start` | Empty | The earliest time of day, as `HH:mm` on a 24-hour clock. |
| Until time | `scheduleTimeEnd` → `schedule-time-end` | Empty | The latest time of day. When it is earlier than From time, the window runs past midnight: `22:00` to `06:00`. |

## Acquisition

Where the visitor came from. Overlay only.

| Setting | Key and attribute | Default | What it does |
| - | - | - | - |
| Direct traffic only | `requireDirectTraffic` → `require-direct-traffic` | Off | Open only when the visitor has no referrer: a typed address or a bookmark. |
| Referrers | `referrerInclude` → `referrer-include` | Empty | Fragments separated by commas, such as `google.com, newsletter.example`. The page the visitor came from must have one of them in its address. Empty allows any referrer. |
| URL includes | `urlIncludePatterns` → `url-include-patterns` | Empty | Patterns for the current page, written like the ones of Exclude URLs. The pop-up opens only on a page that matches one. |
| UTM source | `utmSourceMatch` → `utm-source-match` | Empty | The page's `utm_source` must contain this text, ignoring case. |
| UTM medium | `utmMediumMatch` → `utm-medium-match` | Empty | The page's `utm_medium` must contain this text. |
| UTM campaign | `utmCampaignMatch` → `utm-campaign-match` | Empty | The page's `utm_campaign` must contain this text. |

## View limits

How often the widget may show, and on which devices.

| Setting | Key and attribute | Default | What it does |
| - | - | - | - |
| Restrictions | `restrictions` | Off | The master switch of this group. It has no attribute of its own: when it is off, none of the four settings below is written to the code. |
| Max # of views | `maxViews` → `max-views` | 10, from 1 to 100000 | A visitor sees the pop-up at most this many times within the Time period. Counted in the visitor's browser. Overlay only. |
| Time period | `timePeriod` → `time-period` | 120, from 1 to 8760 | Hours. A rolling window: a view counts for this long after it. A tag with `max-views` and no `time-period` counts over 24 hours. Overlay only. |
| Display on mobile | `displayOnMobile` → `device-mobile-enabled` | On | Off: the widget is hidden on phones, and nothing is loaded for it. Every target. |
| Display on desktop | `displayOnDesktop` → `device-desktop-enabled` | On | Off: the widget is hidden on computers and tablets. Every target. |

The browser's user agent and touch features decide what a phone is, not the width of the window.

## Attributes the dashboard does not write

A few attributes of the tag are not settings of the screen. They work when you write them by hand.

| Attribute | What it does |
| - | - |
| `overlay-z-index` | The stacking order of a pop-up or floating box: a whole number above 0, up to 2147483647. The default is 99999999. |
| `overlay-full-width` | `true` makes the pop-up a bar as wide as the window, flush with the top or bottom edge. Use it with a `top-` or `bottom-` position; the 20 pixel offset is ignored. |
| `render-mode` | `iframe` shows the widget in an iframe that the script makes, instead of mounting it in the page. The script does that by itself when a widget cannot be mounted in the page. `use-iframe="true"` asks for the same. |
| `autoscale-min-height` | The least height of the box with Autoscale on, in pixels. The default is the tag's `height`. |
| `autoscale-max-height` | The most height of the box, in pixels. The default is 2000, and 20000 is the largest value. |
| `autoscale-debounce` | How long the box waits after the widget changed height, in milliseconds. The default is 150. |
| `autoscale-threshold` | The smallest change of height, in pixels, that moves the box. The default is 5. |
| `autoscale-animate` | Whether the box animates when it changes height. On by default, and off for a visitor whose device asks for reduced motion. |
| `autoscale-animation-duration` | The length of that animation, in milliseconds. The default is 300. |
| `workflow-id` | Makes the tag run a workflow. See [Embed a workflow](https://docs.widgetic.com/docs/api/embedding-workflows.md). |
| `data-api-url` | Written on the `<script>` tag, not on `<widgetic>`: the API the script asks for the composition. |

## Related

> [card] [Embedding widgets](https://docs.widgetic.com/docs/api/embedding.md)
>
> The embed code, the three embed targets, triggers and events, with examples

> [card] [Compositions API](https://docs.widgetic.com/docs/api/compositions.md#content-design-and-embed)
>
> Read the embed schema and save embedSettings


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