# 基礎追蹤 (必要)

Google Tag Manager (GTM) 是使用 Instag 的建議安裝方式，低技術門檻且便於維護，請依下述說明完成 GTM 設置。&#x20;

{% hint style="info" %}
如需要使用程式碼進行安裝，請參考 [程式碼自訂安裝](/doc/cheng-shi-ma-zi-ding-an-zhuang/ji-chu-zhui-zong-bi-yao.md) 區段。
{% endhint %}

## 事前準備 <a href="#shi-qian-zhun-bei" id="shi-qian-zhun-bei"></a>

1. 若您尚未使用過 Google Tag Manager，請參考 [Google 官方說明](https://support.google.com/tagmanager/answer/6102821) 完成帳戶及容器設置。
2. 下載 Instag GTM 預置容器檔案：將下方 Instag GTM json 檔案下載到電腦，接下來的步驟會在 GTM 中使用 「匯入容器」 功能完成快速設定。

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

***

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

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

***

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

<figure><img src="/files/1PLgjAKj3e2hcBb8GOz1" alt=""><figcaption></figcaption></figure>

***

## Step 3. 匯入容器

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

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

***

## Step 4. 設定 網站 ID

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

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

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

***

## Step 5. 提交變更

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

<figure><img src="/files/1S8CXGVTDUUAHGMcyuxT" alt=""><figcaption></figcaption></figure>

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

***

## Step 6. 確認是否安裝正確

1. 請先開啟、瀏覽有埋設追蹤碼網頁
2. Instag 平台點選 「即時」 報表查看，每分鐘更新 5分鐘內數據，若有看到 「即時人數」 恭喜你成功啦！

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


---

# 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/dao-ru-an-zhuang/ji-chu-zhui-zong-bi-yao.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.
