# 搜尋追蹤

{% hint style="warning" %}
需完成 [基礎追蹤 (必要)](/doc/cheng-shi-ma-zi-ding-an-zhuang/ji-chu-zhui-zong-bi-yao.md)
{% endhint %}

## 程式碼

當搜尋送出時，透過 Javascript 填入「搜尋」資料後發送。

<pre class="language-javascript"><code class="lang-javascript">itg('event', 'action',{
  'type': 'search',
  'category': '<a data-footnote-ref href="#user-content-fn-1">string</a>',
  'label': '<a data-footnote-ref href="#user-content-fn-2">string</a>',
  'user':{
    'type': '<a data-footnote-ref href="#user-content-fn-3">string</a>',
    'id': '<a data-footnote-ref href="#user-content-fn-4">string</a>',
    'email': '<a data-footnote-ref href="#user-content-fn-5">string</a>',
    'phone': '<a data-footnote-ref href="#user-content-fn-6">string</a>'
  }
});
</code></pre>

***

## 參數說明

<table><thead><tr><th width="91.33333333333331" data-type="checkbox">必要</th><th width="180">參數</th><th>說明</th></tr></thead><tbody><tr><td>true</td><td>type</td><td><p>string</p><p>搜尋行為，「搜尋」追蹤預設為「search」無須更改。</p></td></tr><tr><td>true</td><td>category</td><td><p>string</p><p>搜尋分類，依據搜尋用途或位置給予代號，將用於「受眾篩選」之條件。</p></td></tr><tr><td>true</td><td>label</td><td><p>string</p><p>搜尋標籤，依據每次搜尋關鍵字紀錄，將用於「受眾篩選」之條件。</p></td></tr><tr><td>false</td><td>user.type</td><td><p>string</p><p>使用者 來源，例如：own, line, facebook, google</p><ul><li>自有會員：own</li><li>Line 來源：line</li><li>Facebook 來源：facebook</li><li>Google 來源：google</li></ul></td></tr><tr><td>false</td><td>user.id</td><td><p>string</p><p>使用者 id，串聯 User ID 資料，讓「受眾篩選」的「整合資訊」條件更加精準。</p></td></tr><tr><td>false</td><td>user.email</td><td><p>string</p><p>使用者 email，將串聯 User Email 資料，讓「受眾篩選」的「整合資訊」條件更加精準。</p></td></tr><tr><td>false</td><td>user.phone</td><td><p>string</p><p>使用者 phone，將串聯 User Phone 資料，讓「受眾篩選」的「整合資訊」條件更加精準。</p></td></tr></tbody></table>

[^1]: 搜尋分類，依據搜尋用途或位置給予代號，將用於「受眾篩選」之條件。

[^2]: 搜尋標籤，依據每次搜尋關鍵字紀錄，將用於「受眾篩選」之條件。

[^3]: 使用者 來源，例如：own, line, facebook, google

[^4]: 使用者 id，串聯 User ID 資料，讓「受眾篩選」的「整合資訊」條件更加精準。

[^5]: 使用者 email，將串聯 User Email 資料，讓「受眾篩選」的「整合資訊」條件更加精準。

[^6]: 使用者 phone，將串聯 User Phone 資料，讓「受眾篩選」的「整合資訊」條件更加精準。


---

# 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://instag.gitbook.io/doc/cheng-shi-ma-zi-ding-an-zhuang/sou-xun-zhui-zong.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.
