> 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/sdk/gen-zong-yong-hulcheng.md).

# 追踪用户旅程

您可以通过在用户访问您的页面时捕获 UTM 参数（例如 `utm_source`, `utm_medium`, `utm_campaign`等）并将它们与最终转化关联，来跟踪每次记录的转化的完整用户旅程。这有助于您了解哪些流量来源和活动带来结果。使用 **Offer18’s WebSDK**，您可以无缝捕获这些 UTM 详细信息，将它们与用户会话关联，并确保在发生转化时准确记录——从而让您对归因和活动表现有全面可见性。

### 要按照以下说明跟踪用户旅程

### **1. Offer 设置**

要跟踪用户旅程，创建 Offer18 仪表板中的 Offer 时，必须在 Offer URL 中以及所有落地页中包含点击 ID 参数和令牌。

{% code overflow="wrap" %}

```
示例：https://example.com/?utm_term=1545&utm_source=affiliate&<YOUR-CLICK-ID-PARAMETER>={tid}
```

{% endcode %}

像此示例链接一样，用户必须将 `<YOUR-CLICK-ID-PARAMETER>` 替换为他们选择的 clickid 参数。

<figure><img src="/files/95aa43ce0dcc9f3524ddcdf055809b73498ddba7" alt=""><figcaption></figcaption></figure>

### 2. 代码放置

在创建 Offer 后，将以下代码片段添加到除订单确认/订单成功（感谢页）之外的所有着陆页中。\
\ <mark style="color:紫色;">放置位置：头部</mark>

{% code overflow="wrap" %}

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

{% endcode %}

<mark style="color:紫色;">放置位置：感谢页/订单成功页（单页）</mark>

<pre class="language-html"><code class="lang-html">&#x3C;script src="https://web-resources.offer18.net/sdk/web/WebSDK.js">&#x3C;/script>
<strong>&#x3C;script>
</strong>    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: '',
        }
    })
&#x3C;/script>

</code></pre>


---

# 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://knowledgebase.offer18.com/zh/wang-luo/sdk/gen-zong-yong-hulcheng.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.
