# 合作伙伴网站抓取要求

作为合作伙伴，您可能需要采取某些步骤，例如配置 User-Agent 标识，以确保 impact.com Regulated Compliance 爬虫可以在经授权的情况下以编程方式访问并从您的网站检索数据而不被中断。本指南主要面向负责管理网站访问和安全设置的开发人员、IT 管理员和技术团队。

#### 如何允许 impact.com 的 Regulated Compliance 机器人

作为合作伙伴，impact.com 的 Regulated Compliance 机器人可能会监控您的网站，以确保特定内容符合您与品牌的协议。每个被监控的项目都需要单独访问您网站，因此包含大量被监控内容的网站将相应收到更多请求。

如果限制了 impact.com 的 Regulated Compliance 机器人（例如返回 HTTP 429 – 请求过多 或 HTTP 403 – 禁止访问），我们可能无法审查和验证您的内容，这可能会影响合规性可见性。

**为确保监控不中断：**

* 使用提供的 User-Agent 将 impact.com Regulated Compliance 机器人加入允许列表。
* 避免阻止或限制来自 impact.com Regulated Compliance 机器人的合法请求。
* 使用请求头中包含的签名验证 impact.com Regulated Compliance 机器人，以确认真实性并防止伪造。
* 通过允许并验证 impact.com Regulated Compliance 机器人，您有助于确保您的内容被准确审查并反映在 impact.com 系统中。

#### User-Agent 标识

我们的爬虫使用自定义 `User-Agent` 在网络请求期间进行自我识别。这允许您作为合作伙伴，将 impact.com 的合规性流量与其他机器人和爬虫区分开来。

允许列表中的 User-Agent 字符串（按示例精确使用）：

```programlisting
Mozilla/5.0 (compatible;Impact.com Agent) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
```

**验证 impact.com 爬虫请求**

为确认传入流量来自 impact.com 爬虫，每个请求都会包含自定义的 HMAC 签名头：

```programlisting
X-Impact-Crawler-Signature: <hmac signature>
```

此签名允许您使用已知的密钥和共享算法对请求进行身份验证。它确保请求源自 impact.com 且未被篡改。

<details>

<summary>签名构成</summary>

**签名构成**

我们使用以下过程来计算签名：

* **秘钥**: `/impact/crawler/signature/`
* **用于签名的数据**: `User-Agent`
* **HMAC 算法：** `HMAC-SHA256`
* **签名输出**: `十六进制字符串`

</details>

<details>

<summary>如何验证（伪代码）</summary>

```programlisting
const crypto = require('crypto');

// 从传入请求中提取头信息
const userAgent = req.headers['user-agent'];
const signature = req.headers['x-impact-crawler-signature'];

const secret = '/impact/crawler/signature/';

// 重新计算签名
const expectedSignature = crypto
  .createHmac('sha256', secret)
  .update(userAgent)
  .digest('hex');

// 比较签名
if (signature === expectedSignature) {
  // ✅ 已验证
} else {
  // ❌ 拒绝或记录以供审查
}
```

{% hint style="danger" %}
**警告：** 请务必使用请求中接收到的确切 `User-Agent` 值。任何如修剪、解码或重新格式化等修改都会导致签名不匹配。
{% endhint %}

</details>

#### 用于受监管合规性监控的 IP 允许列表

为支持持续的 Regulated Compliance 监控，请将以下 IP 地址范围加入允许列表。这可确保来自 impact.com 的流量不会被意外阻止，从而使站点监控得以不中断进行。

**允许以下 IP 范围：**

* 163.116.128.0/17
* 162.10.0.0/17
* 31.186.239.0/24
* 8.39.144.0/24
* 8.36.116.0/24
* 34.145.188.137
* 35.245.212.57
* 34.21.56.213
* 34.48.90.233
* 35.245.229.167
* 34.150.151.151
* 35.245.185.65
* 35.188.242.212
* 34.86.33.122
* 34.145.224.193
* 35.245.135.218
* 35.221.1.178
* 34.150.217.77
* 107.175.80.80
* 162.212.175.22
* 107.172.69.119

我们建议更新您的防火墙或访问控制列表，以允许来自以下 impact.com IP 地址范围的传入流量。

{% hint style="success" icon="memo-circle-info" %}
**建议：** 如需就 Regulated Compliance 监控和机器人访问进行技术协调或咨询问题， [联系支持](https://app.impact.com/secure/advertiser/support/customer-support-portal-flow.ihtml).
{% endhint %}


---

# Agent Instructions: 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/partner/zh/nin-xiang-liao-jie-shen-me/platform-features/tracking/website-crawling-requirements-for-partners.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.
