> For the complete documentation index, see [llms.txt](https://instag.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://instag.gitbook.io/doc/cheng-shi-ma-zi-ding-an-zhuang/fen-xiang-zhui-zong.md).

# 分享追蹤

{% 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': 'share',
  '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="79.33333333333331" data-type="checkbox">必要</th><th width="209">參數</th><th>說明</th></tr></thead><tbody><tr><td>true</td><td>type</td><td><p>string</p><p>分享行為，「分享」追蹤預設為「share」無須更改。</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>分享標籤，依據每次分享管道(facebook、line、google...等)紀錄，將用於「受眾篩選」之條件。</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]: 分享標籤，依據每次分享管道(facebook、line、google...等)紀錄，將用於「受眾篩選」之條件。

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

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

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

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