> For the complete documentation index, see [llms.txt](https://knowledgebase.offer18.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.offer18.com/zh/wang-luo/dian-shang-ji-cheng/woocommerce-1.md).

# WooCommerce

### 步骤 1：创建优惠

对于无 Cookie 跟踪，创建 Offer18 仪表板中的优惠时，必须在优惠 URL 以及所有着陆页中包含 click ID 参数和令牌。

{% code title="示例" overflow="wrap" %}

```
https://shopurl.com/?<YOUR-CLICK-ID-PARAMETER>={tid}
```

{% endcode %}

***

### 步骤 2：安装插件

1. "WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager"，作者 WPCode
2. "WooCommerce Conversion Tracking"，作者 weDevs

#### 操作步骤

1. 登录到 WordPress 管理仪表板。
2. 转到“插件”，搜索 “WooCommerce Conversion Tracking” 和 “WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager”。

<figure><img src="/files/b3bf5294610b866a6c95bfc194fdef4d11c9208c" alt=""><figcaption></figcaption></figure>

3. 安装并激活 “WooCommerce Conversion Tracking” 和 “WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager”。

***

### 步骤 3：代码放置

1. 转到 代码脚本 **»** 页眉和页脚
2. 将下面的代码放入“Header 中的脚本”字段
3. 保存设置

```html
<script src="https://web-resources.offer18.net/sdk/web/WebSDK.js"></script>
<script>
    window.Offer18WebSDK.initializeConversion('<YOUR-CLICK-ID-PARAMETER>');
</script>
```

<figure><img src="/files/fde2806111cf880d2076704e6ef1a4b9dc16b363" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
用户必须将 '\<YOUR-CLICK-ID-PARAMETER>' 替换为创建优惠时使用的 clickid 参数。
{% endhint %}

***

### 步骤 4：在转化跟踪中放置以下脚本

1. 转到转化跟踪（位于 WooCommerce 选项卡的子菜单）。
2. 启用“自定义”，并将下面的代码放入“成功订单”。
3. 保存更改

```html
<script>
    window.Offer18WebSDK.trackConversion({
        domain: '',
        accountId: '',
        offerId: '',
        coupon: '', 
        postbackType: '', // 'iframe' 或 'pixel'
        isGlobalPixel: false, // true 或 false
        allowMultiConversion: false, // true 或 false
        conversionData: {
            event: '', // 事件名称（请指定事件）
            payout: '', // 支付金额（请指定支付金额）
            sale: '', // 销售金额（请指定销售金额）
            currency: '',
            adv_sub1: '',
            adv_sub2: '',
            adv_sub3: '',
            adv_sub4: '',
            adv_sub5: '',
        }
    })
</script>
```

<figure><img src="/files/a5a85230beb28123a3004da1e94e888a3a024205" alt=""><figcaption></figcaption></figure>

***

您可以使用各种 Offer18 回传参数和 WooCommerce 数据属性来收集转化数据。

| **Offer18 回传参数** | **WooCommerce 参数** |
| ---------------- | ------------------ |
| sale             | {order\_subtotal}  |
| adv\_sub4        | {order\_number}    |


---

# 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://knowledgebase.offer18.com/zh/wang-luo/dian-shang-ji-cheng/woocommerce-1.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.
