# Wix

> Add the Taggor snippet to a Wix site, and why a visible component needs an Embed HTML element.

Wix has two places for code, and they do different jobs. **Custom Code** adds scripts to the pages and shows
nothing. **Embed HTML** shows content, and it renders in an iframe.

## Install the snippet and place the component

The tag of a component must be in the page's HTML to show, and Wix's page says visible content goes in an
iframe (Custom Code, `https://support.wix.com/en/article/embedding-custom-code-on-your-site`, read 2026-11-10). The
reliable way is an **Embed HTML** element that holds both the snippet and the tag:

1. In the editor, add an **Embed Code** element, choose **Embed HTML**.
2. Paste the snippet and the tag:

```html title="index.html"
<script async src="https://cdn.taggorcdn.com/s/<site-key>.js"></script>
```
```html title="index.html"
<contact-form heading="Get in touch"></contact-form>
```

Everything in this element lives in its own frame. Size the element to the component's height: the page around
it cannot resize it.

## Limits

- **Custom Code** needs a published site with a connected domain; you choose Head, Body - start or
  Body - end (Wix, 2026-11-10, `https://support.wix.com/en/article/embedding-custom-code-on-your-site`). It holds scripts, not visible
  content.
- Wix does not give support for external code (Wix's help, as read in the research of 2026-11-09 (`docs/research/landing-linguagem-e-integracoes.md`)).
- A **Custom Element** (Add Elements, Embed Code, Custom Element) is the alternative that avoids the iframe;
  Wix asks for a Premium plan, a connected domain and HTTPS, and loads only the JavaScript
  (Custom element, `https://support.wix.com/en/article/adding-a-custom-element-to-your-site`, research of 2026-11-09, `docs/research/landing-linguagem-e-integracoes.md`). We did not
  try it.

## Common problems

- **The component is cut off or has a scrollbar.** The Embed HTML element is a frame with a size of its own:
  make it as tall as the component. The fixture shows the component lives only inside the frame.
- **Two components on the page, one in a frame and one outside.** The snippet belongs to the frame that holds
  it; put the snippet and the tag in the same Embed HTML element.

## How we checked

The fixture `platform-iframe-embed` runs an embed in an `iframe` with `sandbox="allow-scripts"` in
Chromium, Firefox, WebKit and two mobile emulations: the component mounts inside the frame, the page around it
stays untouched, and the frame cannot be reached from the page. Not checked: no Wix site was used, and we do
not know the sandbox attributes Wix gives its element, so the strictest form was tested.
