> 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 Archive Format， `.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. 选择 ![](https://2499487857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhRN1rcrim887TwHLBjac%2Fuploads%2Fgit-blob-777809abc59946fff23d188f8dd6eab7a1c254b2%2F062c3caf463cd136b2b03cca1fc260d33318b9e7499b706bee63670c3b0d9936.svg?alt=media) **记录网络日志** 如果按钮为灰色，请点击开发者工具左上角的按钮。
   * 如果按钮为红色，这表示网络活动已在记录中，你可以继续下一步。
   * 请务必勾选旁边的复选框 *保留日志*.
5. 选择 ![](https://2499487857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhRN1rcrim887TwHLBjac%2Fuploads%2Fgit-blob-ad5ef0bc290692327500c12af5fa2ae9a7e2ddac%2F80b9e46b79bb2741bb4ce9b605558e7578baec2ee99c582319202cfc44b3287e.svg?alt=media) **\[清除]** 以删除浏览器中保留的任何日志记录。
6. 在记录网络请求时下单，以加载感谢页面。
7. 右键单击网络流量中记录的任意活动，然后选择 **将所有内容另存为 HAR（含内容）** 将文件保存到你的计算机。

</details>

<details>

<summary>Firefox</summary>

1. 打开 Firefox 并导航到你的结账页面。
2. 打开开发者工具（检查元素）。
   * Windows 的开发者工具快捷键： **Ctrl + Shift + i**
   * MacOS 的开发者工具快捷键： **Cmd + Option + i**
3. 选择 **网络** 选项卡。
4. 选择 ![](https://2499487857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhRN1rcrim887TwHLBjac%2Fuploads%2Fgit-blob-c5ab8423372b2c345ded634b7aa4cab16c87fe3a%2Fd17a259fe817ff10ea9fd87140a89bd62ece6fa9940e05902574dcf95bed5960.svg?alt=media) **\[删除]** 以删除浏览器中保留的任何日志记录。
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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
