> 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/ads/manage-ads/test-a-dynamic-content-ad.md).

# 测试动态内容广告

保存内容广告后，您可以进行测试，确保重定向路径按预期工作。最简单的方法是将内容广告发送到您的测试合作伙伴账户。

{% stepper %}
{% step %}

## 分享至合作伙伴账户

1. 在左侧导航菜单中，选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-230534471fef5f40808e921e41ee44e4a06ded03%2Fe6cb9548999afdc1ed3ce4942e4cb5b45b5cecbd323267aac2a7cd1915fccc09.svg?alt=media) **\[互动] → 内容 → 广告**.
2. 在 *广告* 页面上，在列表中找到您的内容广告，然后选择 **分享**.
3. 在 *发送广告* 页面上，找到 *合作伙伴* 字段，使用 **搜索框** 添加您的测试合作伙伴账户。
4. 在页面底部，选择 **发送广告**.

<div data-with-frame="true"><figure><img src="https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FvvrhYMCmtKuUpvVMu6HD%2FScreenshot%202026-05-08%20at%2011.00.50.png?alt=media&amp;token=363283dd-5885-400d-a21e-b9bf06e308bf" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

## 在合作伙伴账户中测试

1. 在新的浏览器窗口（或无痕标签页）中， **登录** 您的测试合作伙伴账户。
2. 在顶部导航菜单中，选择 **内容 → 素材**.
3. 选择该广告，然后在弹出的对话框中选择 **素材代码 → 复制代码**.
   * 在代码块中，验证您的绝对链接是否已变为追踪链接。
     {% endstep %}

{% step %}

## 排查验证错误

在 [创建或更新](https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/platform-features/ads/create-an-asset.md) 内容广告时，您可能会看到以下错误消息。您可以按照以下方法解决：

| 验证错误                              | 说明                                                                                                |
| --------------------------------- | ------------------------------------------------------------------------------------------------- |
| *“No replaceable links present”*  | impact.com 无法在 *内容* 字段中检测到可替换的链接。链接必须包含协议。使用 `http` 的链接将自动转换为 `https`.                            |
| *“Ad name cannot be empty”*       | 您必须在 *名称* 字段中为内容广告提供名称。                                                                           |
| *"URL on anchor is not absolute"* | 在 *内容* 中至少有一个链接不是绝对链接。绝对链接使用以 `http://` 或 `https:// 开头的完整路径`。检查是否存在语法问题，例如 href= 前后是否有空格 `href=`. |
| {% endstep %}                     |                                                                                                   |
| {% endstepper %}                  |                                                                                                   |

## 动态内容广告示例

在下方提供的 *示例代码* 中，我们包含了：

* 一个带有文本框和“提交”按钮的 HTML 表单
* 嵌入式 CSS，用于设置表单样式，使其独立于其他内容
* 一个 `<div>` 容器，用于放置微件
* 一个 JavaScript 函数，用于动态创建 impact.com 跟踪链接并附加查询字符串参数
* 一个 `<noscript>` 标签，以便系统在没有外链时接受脚本（如果没有此标签，尝试上传此创意素材时会遇到错误。）

  实际上，这些元素中有许多可以托管在你的网站上或嵌入到网站中；impact.com 支持用于动态内容的外部 HTML、CSS 和 JavaScript 文件。
* JavaScript 代码使用动态令牌生成跟踪 URL，并将搜索词作为查询字符串参数附加。
* 由于内容没有绝对 URL，我们使用 `{domain}`, `{irpid}`, `{iradid}`和 `{ircid}` 作为动态令牌来生成跟踪链接，其中会填入计划的跟踪域名、合作伙伴 ID、广告 ID 和计划 ID 值。请参阅 [动态令牌参考](#dynamic-token-reference) ，了解所有可用令牌。
* 客户点击后会先经由 impact.com 跳转，然后转到着陆页——在此示例中，着陆页为 `https://www.example.com`

<details>

<summary>示例代码</summary>

```html
<style type="text/css">  
#search-widget-container 
{    font-family:"Verdana";
     padding:20px;     
     width:280px;    
     height:75px;
     margin:30px;
     background:#FFFFFF;
     border:1px solid #BBBDBF;
     border-radius:6px;
     box-shadow:5px 5px 2px rgba(0,0,0,0.1);   }   
     #submitbutton 
     {background:#fff;
     color:#3B91CF;
     font-weight:bold;
     font-size:12px;
     padding:5px:
     border-radius:6px;
     border:1px solid #3B91CF;
     cursor:pointer;   }   
    #submitbutton:hover {    
     background:#3B91CF;
     color:#fff;  }
     #searchbox {
      width:200px;
      margin:10px 10px 10px 0px;   }
</style>
<div id='search-widget-container'>
<img src="http://www.impactradius.com/wp-content/uploads/2014/05/impact-radius-logo.png" width="150px">  
<form><input name='searchTerm' 
   id='searchBox'
   type='text' 
   placeholder='搜索此网站'>
    <input onClick="searchFunction()" 
     type='submit' 
     value='提交'
     id='submitbutton'>
 </form>
</div>
<script type="text/javascript">
function searchFunction() {  
// 从搜索框获取用户提交的值 
var searchTerm = document.getElementById("searchBox").value;  
var landingPage = "http://{domain}/c/{irpid}/{iradid}/{ircid}?p.searchTerm=";
// 将 searchTerm 添加到 landingPage 的末尾
var completeURL = landingPage.concat(searchTerm);
// 将客户重定向到最终完整 URL
window.location.href = completeURL;   } 
</script>
<noscript>
<a href=”http://www.example.com”>无脚本时显示的链接</a>
</noscript>
```

</details>

<details>

<summary>动态令牌参考</summary>

| 令牌                      | 支持位置        | 说明                                 |
| ----------------------- | ----------- | ---------------------------------- |
| `{irpid}`               | 素材内容 / 曝光像素 | 填入合作伙伴的 impact.com 合作伙伴 ID。        |
| `{iradid}`              | 素材内容 / 曝光像素 | 填入分配给该广告的广告 ID。                    |
| `{ircid}`               | 素材内容 / 曝光像素 | 填入分配给您的计划的 impact.com 计划（或广告系列）ID。 |
| `{subId1}` - `{subId3}` | 素材内容        | 填入合作伙伴的 SubId 值（用于跟踪和报告）。          |
| `{sharedId}`            | 素材内容        | 填入合作伙伴的 SharedId 值，用于报告。           |
| `{domain}`              | 素材内容 / 曝光像素 | 填入您计划的跟踪域名。                        |
| `{timestamp}`           | 素材内容        | 广告被检索时，填入时间戳（Unix 纪元格式）。           |
| `{randint}`             | 素材内容 / 曝光像素 | 广告被检索时，填入随机生成的整数。                  |

</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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/platform-features/ads/manage-ads/test-a-dynamic-content-ad.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
