> 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/dao-ru-an-zhuang/kai-dian-ping-tai-she-zhi/qdm.md).

# Qdm

## 事前準備

1. 必須先完成 [基礎追蹤 (必要)](/doc/dao-ru-an-zhuang/ji-chu-zhui-zong-bi-yao.md)
2. 下載 GTM Qdm 追蹤碼

{% file src="/files/tOONPzOXD9Xta4CyJOg6" %}

{% hint style="info" %}
Qdm 匯入安裝包含以下項目：

1. 瀏覽商品追蹤
2. 購物車追蹤
3. 購買追蹤
4. 商品分享
5. 加入願望清單
6. 會員登入
7. 商店留言板
8. 訂單查詢
   {% endhint %}

***

## Step 1. 進入 [GTM 後台](https://tagmanager.google.com/#/home)，開啟 「容器設定」

<figure><img src="https://2075385674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8vmX591TX7ccV7n1Qcw%2Fuploads%2FTSYHAe4AogQHY3DmH5xO%2Fimage.png?alt=media&amp;token=098c37f6-0abc-4e7d-93f6-9f2f105b543b" alt=""><figcaption></figcaption></figure>

***

## Step 2. 點選 「匯入容器」

<figure><img src="https://2075385674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8vmX591TX7ccV7n1Qcw%2Fuploads%2FmKlKUGi2f2q1GJfm4m4z%2Fimage.png?alt=media&amp;token=4fdf03a9-8cbd-4956-950e-9dc341845cdc" alt=""><figcaption></figcaption></figure>

***

## Step 3. 匯入容器

1. 選取要匯入的檔案 ：選擇 [事前準備](#shi-qian-zhun-bei) 中下載到的 json 檔案。
2. 選擇工作區：選擇 「現有」 並點選您正在使用的工作區，一般沒特別設定則直接選擇 "Default Workspace"。
3. 選擇匯入選項： 選擇 「合併」 > 「覆寫有衝突的代碼、觸發條件和變數。」
4. 點擊 「確認」 完成匯入。

<figure><img src="https://2075385674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8vmX591TX7ccV7n1Qcw%2Fuploads%2FsNCpWlCmp9jG9ACmuIGt%2Fimage.png?alt=media&amp;token=3f16b09e-6b13-47e2-b808-f563d704e71f" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
請先用 「預覽」 功能測試，確認 「Tags Fired」 是否有觸發成功
{% endhint %}

***

## Step 4. 設定 網站 ID

1. 至[ Instag 平台](https://pro.instag.ai/)進入 「帳戶 > 網站 > 資訊」，複製 「網站 ID」
2. 至 Google Tag Manager 將 「變數 variable > Instag Site ID」 值從 0 更換為您的網站 ID，接著按下 「儲存」

<figure><img src="https://2075385674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8vmX591TX7ccV7n1Qcw%2Fuploads%2F4UoOZ8sRcvGlK1LfXlyd%2Fimage.png?alt=media&amp;token=2c66364a-ac86-45b3-b2b9-81be60a65254" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2075385674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8vmX591TX7ccV7n1Qcw%2Fuploads%2FTUI6OYMSpeFbIufZmK1v%2Fimage.png?alt=media&amp;token=8a1ba484-59da-4db2-ab07-331f1b7086d5" alt=""><figcaption></figcaption></figure>

***

## Step 5. 提交變更

按下右上角 「提交」，再按下 「發布」 按鈕即可完成設置。

<figure><img src="https://2075385674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8vmX591TX7ccV7n1Qcw%2Fuploads%2FdhD5z07A5XkHONgqMlvy%2Fimage.png?alt=media&amp;token=14e64d15-db98-40e3-a1c6-58873b6bd5b8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2075385674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA8vmX591TX7ccV7n1Qcw%2Fuploads%2FnEdKXMhZ92M7Plv2XIQd%2Fimage.png?alt=media&amp;token=e99d4f11-68a5-473a-ab1c-1c4b0416b0e6" alt=""><figcaption></figcaption></figure>


---

# 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://instag.gitbook.io/doc/dao-ru-an-zhuang/kai-dian-ping-tai-she-zhi/qdm.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.
