> For the complete documentation index, see [llms.txt](https://helps.ptengine.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helps.ptengine.com/cn/faq/tracking-code.md).

# 基础代码

代码本身的部署、加载方式和性能影响——这类偏技术的问题在这里。

***

## 你遇到的是哪种情况 <a href="#pick-your-symptom" id="pick-your-symptom"></a>

| 症状               | 看这篇                                                                                        |
| ---------------- | ------------------------------------------------------------------------------------------ |
| 代码确认部署了，但一条数据都没有 | [基础代码正确部署但没有数据流入](https://helps.ptengine.com/cn/faq/tracking-code/no-data-after-deploy.md) |
| 纠结用同步还是异步加载      | [推荐基础代码同步加载](https://helps.ptengine.com/cn/faq/tracking-code/sync-load-recommendation.md)  |
| 担心代码拖慢页面         | [基础代码对页面加载速度的影响](https://helps.ptengine.com/cn/faq/tracking-code/page-load-impact.md)      |
| 子域名要不要单独装代码      | [网站子域监测](https://helps.ptengine.com/cn/faq/tracking-code/subdomain-tracking.md)            |
| 通过标签管理工具部署时的各种问题 | [标签设置常见问题](https://helps.ptengine.com/cn/faq/tracking-code/tag-setting-faq.md)             |

***

## 部署位置的基本原则 <a href="#placement-basics" id="placement-basics"></a>

* 推荐**直接写进 HTML 的 `<head>` 里**，同步加载——这样数据最完整、最可靠
* 用 Google Tag Manager 等工具部署也可以，但要注意触发时机，见 [Google Tag Manager 中的标签设置](https://helps.ptengine.com/cn/start-guide/othertag/tag-gtm.md)
* **Shopify 站不要直接写进 HTML**，按 [Ptengine for Shopify 应用安装](https://helps.ptengine.com/cn/start-guide/othertag/tag-shopify-app.md) 的方式接入

***

## 相关页面 <a href="#related-pages" id="related-pages"></a>

* [基础代码的安装方法](https://helps.ptengine.com/cn/start-guide/quick/tag-setup.md)
* [其他安装方法](https://helps.ptengine.com/cn/start-guide/othertag.md)
* [确认基础代码是否正常发送](https://helps.ptengine.com/cn/faq/start-guide/check-tag-firing.md)
