---
title: "Custom code and embeds"
description: "On Studio, add code to every published page of your site, or place a tool from another service on a page with the Embed block."
url: "https://www.litetile.io/docs/settings/custom-code"
lang: "en"
---

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.

Note

Studio. Custom code and the Embed block are on the Studio plan. On Free, the **Custom code** tab is read-only and says "Custom code is on the Studio plan.", with an upgrade link. See [Plans and billing](https://www.litetile.io/docs/account-and-billing/plans-and-billing).

Warning

Code you add "Runs outside the consent banner on published pages only." Never paste code you do not trust. It runs on your site exactly as you typed it, and litetile does not check it.

## Code on every page

Use this for code a service asks you to place on every page, such as a chat widget.

1. In your site's dashboard, open **Settings**, then **Custom code**.
2. 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.
3. 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."
4. Choose **Save changes**.

![Settings: custom code tab with warning.](https://media.litetile.app/media/6eee3550-99b4-4494-8fc5-d588d1e67e1e/9105f85b-7e09-488a-9742-21f62e03cd81.png)

The code reaches your live site when you publish the **Site settings** item from your site's Overview. See [Publish changes](https://www.litetile.io/docs/publishing/publish-changes). It never runs in the editor or in previews, so check it on the published site.

## The Embed block

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](https://www.litetile.io/docs/editor/blocks).

1. Add an **Embed** block where the tool should appear.
2. Paste the snippet the service gives you into **Embed code**.
3. Set the heading and the options below.
4. Publish the page, then check the tool on the live page.

![The editor settings panel with an Embed block selected.](https://media.litetile.app/media/6eee3550-99b4-4494-8fc5-d588d1e67e1e/81f57b60-a78e-466a-b040-56f73ab5eb40.png)

The Embed block

- 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."

Tip

An image, an SVG drawing or an animation is not an embed. Upload it on the **Media** screen and show it with a Figure block or an image field.

## Your own AI assistant

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](https://www.litetile.io/docs/ai/connect-your-own-assistant).

## If the site moves to Free

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](https://www.litetile.io/docs/account-and-billing/plans-and-billing).
