---
title: "Advanced: code, tracking and CSS - Lentil docs"
description: "Add site-wide CSS and tracking or verification tags, edit the shared header and footer HTML, and restore earlier versions of each."
url: https://uselentil.com/docs/advanced
updated: 2026-11-13
site: "Lentil"
---

[Docs](https://uselentil.com/docs)

### Docs menuAdvanced: code, tracking and CSS

# Advanced: code, tracking and CSS

Most sites never need this page. When you do, Settings has one place for code that applies to every page: site-wide CSS, tracking and verification tags, and the header and footer HTML.

## Open Advanced

1. Open your site, choose **Settings** in the sidebar, then **Advanced** (described as **Shared HTML, custom CSS & deletion**).
2. The page opens with **These changes affect every page. Use the AI editor for individual page content.**
3. Edit a box, then press **Save changes** in the bar at the bottom. The bar shows how many changes are unsaved, and **Discard** throws them away.

Everything saved here applies to your published pages right away. Each part keeps its own history, so you can go back (see History and undo).

## Add your own CSS

The **Site CSS** card is for styling you want on every page, such as a button or card look. It is added to every page after the theme, so it can refine the theme's colors and fonts. For the theme itself, use [Design and theme](https://uselentil.com/docs/design) instead.

1. In **Site CSS**, type plain CSS in the **CSS** box, for example `.btn { border-radius: 4px; }`.
2. Press **Save changes**. Your published pages are updated; the bar says how many pages are being refreshed.

CSS is plain CSS onlyIt cannot contain `</style`, and it is limited to 128 KB.

Ask your assistant

```
On Rosa's Bakery, add site CSS so every link in the footer is underlined on hover. Show me the CSS you plan to add before you save it.
```

Uses `get_shared_part`, `replace_shared_part`. [Connect an assistant](https://uselentil.com/docs/ai-assistants)

## Add tracking and verification code

The **Tracking and verification code** card is for analytics, chat widgets and search verification tags. It has two boxes: **In the page head** for tags such as `<meta name="google-site-verification" content="...">`, and **At the end of the page** for scripts. Scripts run on the published site only, never in the editor.

1. Paste the snippet your tool gave you into the box it names: **In the page head** or **At the end of the page**.
2. Press **Save changes**.
3. Open a published page of your site and check that the tool sees it.

The code goes on every published page. For a site that stays hosted elsewhere, Lentil uses its own tracking snippet instead; see [Already have a website](https://uselentil.com/docs/existing-website).

Only paste code you trustA script on your site can read everything on a page, including what visitors type into forms. Use snippets from the tool's own instructions, and nothing from a stranger.

## Header and footer HTML

The **Header and footer HTML** card shows the code behind the shared header and footer, in a **Header** box and a **Footer** box. It is easier to change them in the page editor; use these boxes when you need to paste markup. See [The page editor](https://uselentil.com/docs/editor). Each box is limited to 256 KB.

## History and undo

The header, footer, site CSS and tracking code each have a **History** button on their card. Press it to see earlier versions and restore one. Restoring keeps the history, so you can change your mind again.

## Who can use it

- Owners, admins, members and clients can change Advanced settings, including site CSS, tracking code, and the header and footer HTML. See [Team and roles](https://uselentil.com/docs/team).
- Available on Free and Pro.

## Limits and edge cases

- Site code (both tracking boxes together) is limited to 512 KB. Over the limit, the larger box shows **Site code is larger than 512 KB in total. Shorten this field.**
- Site CSS is limited to 128 KB, and the header and footer HTML to 256 KB each.
- Tracking boxes cannot contain `<template>` tags. The box tells you to remove them.
- If someone else changed the same part since you opened it, the save is refused so nothing is overwritten. Reload and try again.

## From an AI assistant

An assistant connected to Lentil works with your role. See [AI assistants](https://uselentil.com/docs/ai-assistants).

- `get_shared_part` with `part` set to `header`, `footer`, `code` (the site code) or `css`: read it with its `currentVersionId`.
- `replace_shared_part`: replace a whole part (header and footer up to 256 KB, site code 512 KB, CSS 128 KB), passing the `baseVersionId` it read. `edit_shared_part` edits single header or footer elements.
- `update_theme`: change theme colors and fonts, or the site CSS (`designLanguageCSS`).
- `list_shared_part_versions`, `get_shared_part_version`, `restore_shared_part_version`: history and undo.

Safety rules: changes to shared parts, the theme and site CSS go live on published pages immediately, so an assistant should confirm with you first.

**Still have a question?**Write to us from **Help & support** in the app's account menu, or from our contact page.

[Contact support](https://uselentil.com/contact)

Updated 9 November 2026
