Custom code and embeds
At the end of this guide you have code from another service running on your published site: on every page through Custom code, or in one place on a page through the Embed block.
Use this for code a service asks you to place on every page, such as a chat widget.
- In your site's dashboard, open Settings, then Custom code.
- Paste the code into Head ("Injected at the end of <head> on published pages") or Body ("Injected at the end of <body> on published pages"), as the service's instructions say.
- Check the size under each field. Each holds up to 256 KiB; over that, the field says "Over 256 KiB. Shorten this code to save it."
- Choose Save changes.

The code reaches your live site when you publish the Site settings item from your site's Overview. See Publish changes. It never runs in the editor or in previews, so check it on the published site.
The Embed block places a tool from another service, such as a booking calendar or a map, at one spot on a page, under a short heading. Add it like any of the blocks (the sections of a page): see Add, move and hide blocks.
- Add an Embed block where the tool should appear.
- Paste the snippet the service gives you into Embed code.
- Set the heading and the options below.
- Publish the page, then check the tool on the live page.

| Option | What it does |
|---|---|
| Eyebrow, Title, Subtitle | The short heading above the tool |
| Embed code | The snippet, up to 16 KB. "Runs as typed on the published site only, outside the consent banner." |
| Load | When visible loads the tool as the visitor scrolls near it. Immediately loads it with the page |
| Width | Content or Wide |
| Height | 50%, 75% or 100% of the screen height. The tool scrolls inside this box, so the page never jumps while it loads |
| Vertical padding | Top and bottom, Top only, Bottom only or None |
| Anchor | A name for the block's address, so links can open the page at this block |
| Background | The block's background |
In the editor the block shows "Embedded content shows here on the published site." in place of the tool. A snippet over the limit shows "Keep the embed code to 16 KB."
An assistant connected with an AI access token can change custom code and Embed blocks only if you turned on Allow custom code and embeds on its token. When it has changed custom code, the publish dialog shows "Custom code changed by your AI assistant on" a date under Site settings, so you can review it before you publish. See Connect your own AI assistant.
Your code is kept, but it stops running: custom code is left off the live site and Embed blocks are left out of its pages. Both come back when the site returns to Studio. See Plans and billing.
