> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/other/zh/reference-documentation/generate-a-har-file.md).

# 生成 HAR 文件

HAR（HTTP 归档格式， `.har`）是一种包含 JSON 数据的归档文件格式，用于存储多种浏览器类型（例如 Firefox、Chrome、Safari 等）的会话数据。HAR 文件会保存浏览器发出的所有网页请求信息。

HAR 文件提供了所有网络活动的详细日志，使 impact.com 解决方案工程师能够调查各种技术问题。\
其中包括：

* 确认跟踪标签是否正确触发。
* 诊断显示问题，例如页面未加载或平台功能未按预期显示。
* 识别性能瓶颈，例如加载缓慢的脚本或图片。
* 分析浏览器发送和接收的精确数据，以排查复杂错误。

#### 生成 HAR 文件

请选择你使用的浏览器，以查看生成 HAR 文件的说明。

<details>

<summary>Google Chrome</summary>

1. 打开 Chrome 并进入你的结账页面。
2. 打开开发者工具（检查元素）。
   * Windows 的开发者工具快捷键： **Ctrl + Shift + i**
   * MacOS 的开发者工具快捷键： **Cmd + Option + i**
3. 选择 **网络** 选项卡。
4. 选择 ![](/files/9b0e2c403d958254ab0416794a589972484425ee) **记录网络日志** 按钮，如果该按钮是灰色的。
   * 如果该按钮是红色的，这意味着网络活动已在记录中，你可以继续下一步。
   * 请务必勾选 *保留日志*.
5. 选择 ![](/files/738b6f95f3bda036f8de42e510c39ee9f5da1a89) **\[清除]** 以删除浏览器中保存的任何日志记录。
6. 在记录网络请求时完成下单，让感谢页面加载。
7. 右键单击网络流量中记录的任何活动，并选择 **将所有内容另存为 HAR** 将文件保存到你的电脑。

</details>

<details>

<summary>Firefox</summary>

1. 打开 Firefox 并进入你的结账页面。
2. 打开开发者工具（检查元素）。
   * Windows 的开发者工具快捷键： **Ctrl + Shift + i**
   * MacOS 的开发者工具快捷键： **Cmd + Option + i**
3. 选择 **网络** 选项卡。
4. 选择 ![](/files/1526c03443cccae500f3484a361ef130df1ee690) **\[删除]** 以删除浏览器中保存的任何日志记录。
5. 在记录网络请求时完成下单，让感谢页面加载。
6. 右键单击网络流量中记录的任何活动，并选择 **全部另存为 HAR** 将文件保存到你的电脑。

</details>

<details>

<summary>Safari</summary>

1. 打开 Safari 并进入你的结账页面。
2. 按 **Option + Command + i** 作为打开此页面开发者工具的快捷键。
   * 你需要启用开发者工具才能使用此功能。前往 **偏好设置 → 高级 → 显示“开发”菜单** .
3. 选择 **网络** 选项卡。
4. 确保 **导航时保留日志** 按钮已开启，然后选择 **清除** 按钮。
5. 在记录网络请求时完成下单，让感谢页面加载。
6. 右键单击网络流量中记录的任何活动，并选择 **导出为 HAR 文件** 将文件保存到你的电脑。

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.impact.com/other/zh/reference-documentation/generate-a-har-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
