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

# 如何在 LanderLab 中为域名添加全局脚本

> 了解如何使用 LanderLab 的域名级自定义代码设置，在某个域名下的所有落地页中注入全局跟踪像素、分析脚本或自定义样式。

域名级自定义代码会被注入到该域名下发布的每个页面中。任何需要在所有页面上运行的内容都可以放在这里：标签管理器、分析脚本、跟踪像素或全局 CSS。

## 在哪里找到

打开 **Settings > Domains**，点击域名旁边的**三点菜单（...）**，选择 **Settings**，然后打开 **Custom Code** 标签页。

<Frame>
  <img src="https://mintcdn.com/landerlab-babdc23f/uFlGyN3HYm5JP0-g/images/domain-custom-code.jpg?fit=max&auto=format&n=uFlGyN3HYm5JP0-g&q=85&s=1f4b1ac58a20e551953c1b9603e87472" alt="域名设置的 Custom Code 标签页，包含 head 和 body 代码面板" width="1568" height="737" data-path="images/domain-custom-code.jpg" />
</Frame>

<Note>
  只有当域名处于 **Active** 状态时，**Settings** 才可用。
</Note>

## 两个面板

| 面板 | 用途 |
| :- | :- |
| **Inside head before `</head>`** | 需要尽早加载的跟踪像素、标签管理器和分析工具。 |
| **Inside body before `</body>`** | 需要页面内容先加载的脚本，以及要求放在 `</body>` 之前的小组件。 |

将代码粘贴到对应的面板中，然后点击 **Save**。如果不确定该用哪个面板，请参考你所添加工具的安装说明——大多数工具都会注明。

<Warning>
  已上线的落地页需要[重新发布](/zh/features/landing-pages/operations/republish)后，新代码才会生效。
</Warning>

<Tip>
  如果某个脚本只应在一个落地页上运行，请改用该页面自己的[自定义代码设置](/zh/features/landing-pages/settings/custom-code)。
</Tip>


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