> 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/brand/zh/what-would-you-like-to-learn-about/platform-features/promo-codes/bulk-upload-promo-codes.md).

# 批量上传促销代码

如果你想创建多个促销代码，请使用 **批量上传** 该功能可上传包含促销代码数据的 CSV、XLS 或 XLSX 文件。

请参见 *促销代码批量上传参考* 下方表格可帮助你构建此文件。为确保上传成功，XLS/XLSX 文件大小请保持在 1MB 以下，CSV 文件请保持在 5MB 以下。验证严格基于文件大小，因此对行数没有具体限制。

{% hint style="warning" %}
**警告：** 请确保 CSV/XLS 文件中的列标题与下方列名完全一致（区分大小写且包含空格），否则文件上传可能会被拒绝。
{% endhint %}

{% hint style="info" %}
**示例：** 下方示例是一个示例促销代码 `10PEROFF`.

```programlisting
促销代码,Campaign Id,Media Id,类型,Credit Rule,匹配模式,Deal
Name10PEROFF,4321,1299679,TRACKING,ALWAYS,LI,
```

{% endhint %}

#### 批量上传跟踪型促销代码

1. 从左侧导航菜单中，选择 ![](/files/209022bdb234289211a24a980f6227a8684cc439) **\[Engage]** → **内容** → **促销代码**.
2. 在 *促销代码* 在……页面中，选择 **批量上传**.
3. 选择 **选择文件** 然后找到并选择你要上传的包含促销代码的 Excel/CSV 文件。

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>注意：</strong> 确保你的文件使用下表所示的必需列格式。</p></div>

   | 列      | 类型  | 必填 | 描述                                                                                                         |
   | ------ | --- | -- | ---------------------------------------------------------------------------------------------------------- |
   | 促销代码   | 字符串 | 是  | 要分配的唯一促销代码。                                                                                                |
   | 项目 ID  | 整数  | 是  | 广告所属的唯一 impact.com 项目 ID。                                                                                  |
   | 媒体 ID  | 整数  | 是  | 将分配促销代码的 impact.com 媒体 ID。可以是 Partner Id 或 Media Source Id。                                                |
   | 类型     | 字符串 | 是  | <p>促销代码类型。允许的值：</p><p><code>TRACKING</code></p>                                                            |
   | 归因规则   | 字符串 | 是  | <p>促销代码归因规则。允许的值：</p><p><code>ALWAYS</code></p><p><code>INVOLVED</code></p><p><code>WINNER</code></p>      |
   | 匹配模式   | 字符串 | 是  | <p>促销代码匹配模式。允许的值：</p><p><code>LI</code> （精确/字面）</p><p><code>RE</code> （正则表达式/Regular Expression）</p>       |
   | 交易 ID  | 整数  | 否  | 此促销代码应关联的交易的唯一 ID。该交易必须已存在于你的项目中。                                                                          |
   | 生效开始日期 | 日期  | 否  | 让你能够安排此限制的生效时间。这是一个 [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) 日期。示例格式： `2013-06-30T00:00:00-07:00` |
   | 生效结束日期 | 日期  | 否  | 这是一个 ISO8601 日期。示例格式： `2013-06-30T00:00:00-07:00`                                                          |
   | 时区     | 字符串 | 否  | 时区会从开始日期推导，但如果你想用特定时区覆盖，请在此处输入完整名称，例如 `America/New_York`.                                                  |

   每个已上传的跟踪型促销代码只能通过 `媒体 ID` 字段分配给 1 个合作伙伴或媒体来源。如果其他合作伙伴推广该代码，impact.com 会将由此产生的转化标记为无效转化并撤销。
4. 选择 **下一步**.
5. 请检查即将上传的促销代码列表。如果详情正确，请选择 **接受并创建促销代码**.
6. 如果上传成功，新的 *跟踪型促销代码* 将被创建并列在 *促销代码* 页面中。

#### 受限促销代码字段批量上传

{% hint style="info" %}
**注意：** 作为持续平台改进的一部分，我们将在 *受限促销代码* 功能将于 2 月底停用。请检查您当前的配置并相应规划。
{% endhint %}

在开始之前，请先了解这两种限制类型的区别：

* **白名单**
  * 目的：定义一组必须使用的促销代码，合作伙伴才能获得销售归因。
  * 如果你的授权促销代码列表比未授权列表更小，建议使用此方式。
* **黑名单**
  * 目的：定义一组促销代码，如果使用这些代码，则不会将销售归因给合作伙伴。
  * 如果你的未授权促销代码列表比授权列表更小，建议使用此方式。

**步骤 1：选择限制类型**

1. 从左侧导航菜单中，选择 ![](/files/209022bdb234289211a24a980f6227a8684cc439) **\[Engage]** → **内容** → **促销代码**.
2. 在 *促销代码* 在……页面中，选择 **创建促销代码** ![](/files/9ee7bd3c79aae4d0667377d18611647c3469f8d1) **\[下拉菜单]** → **受限**.
3. 在 *促销代码限制* 页面，然后选择 ![](/files/a4d92afe6e302635e52a9d3b155bca7a8dedb2ea) **设置促销代码限制**.
4. 将显示“促销代码限制”页面，其中包含两个设置列：
   * 如有需要，选择 ![](/files/a4d92afe6e302635e52a9d3b155bca7a8dedb2ea) **设置白名单**，用于上传白名单促销代码。
   * 如有需要，选择 ![](/files/a4d92afe6e302635e52a9d3b155bca7a8dedb2ea) **设置黑名单**，用于上传黑名单促销代码。

**步骤 2：上传你的文件**

1. 选择 **选择文件**，然后找到并选择你要上传的包含受限促销代码的 Excel/CSV 文件。

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>注意：</strong> 确保你的文件使用下表所示的必需列格式。</p></div>

   | 列      | 类型  | 必填 | 描述                                                                                                   |
   | ------ | --- | -- | ---------------------------------------------------------------------------------------------------- |
   | 促销代码   | 字符串 | 是  | 要分配的唯一促销代码。                                                                                          |
   | 项目 ID  | 整数  | 是  | 广告所属的唯一 impact.com 项目 ID。                                                                            |
   | 类型     | 字符串 | 是  | <p>促销代码类型。允许的值：</p><p><code>RESTRICTED</code></p>                                                    |
   | 匹配模式   | 字符串 | 是  | <p>促销代码匹配代码。允许的值：</p><p><code>LI</code> （精确/字面）</p><p><code>RE</code> （正则表达式/Regular Expression）</p> |
   | 生效开始日期 | 日期  | 否  | 让你能够安排此限制的生效时间。这是一个 ISO8601 日期。示例格式： `2013-06-30T00:00:00-07:00`.                                    |
   | 生效结束日期 | 日期  | 否  | 这是一个 ISO8601 日期。示例格式： `2013-06-30T00:00:00-07:00`                                                    |
   | 时区     | 字符串 | 否  | 时区会从开始日期推导，但如果你想用特定时区覆盖，请在此处输入完整名称，例如 `America/New_York`.                                            |
2. 选择 **下一步**.
3. 请查看显示在 *促销代码批量上传* 页面上的受限代码列表。
   * 如有需要，仅查看包含错误的条目时，请选择 **仅显示错误**.
4. 如果详情正确，请选择 **接受并创建促销代码**.

**步骤 3：添加媒体合作伙伴例外**

1. 在 *媒体合作伙伴控制* 页面，选择限制规则的适用方式：
   1. 如有需要，选择 **应用于所有合作伙伴**，如果你希望此规则适用于所有人。
   2. 如有需要，选择 **允许特定合作伙伴绕过此规则，并因受限促销代码获得归因**.

      如果你选择允许绕过，请选择 **查找** 然后选择并 **添加** 列表中的特定合作伙伴。
2. 选择 **保存并激活**.
3. 新的受限促销代码规则已激活，上传的代码将应用于所选的 *白名单* 或 *黑名单*.


---

# 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/brand/zh/what-would-you-like-to-learn-about/platform-features/promo-codes/bulk-upload-promo-codes.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.
