通知

Google Analytics (分析):GA4 設定代碼現已改稱 Google 代碼。自 9 月起,系統將自動遷移網站容器中的 GA4 設定代碼。現有的評估方式沒有任何改變,您也無須採取任何行動。瞭解詳情

Square Online:設定 Google 代碼

您可以使用 Google Analytics (分析) 和 Google Ads 評估網站上的使用行為資料。請按照本文中的步驟,使用 Square Online 設定 Google Analytics (分析) 和 Google Ads 帳戶。

事前準備

您必須擁有 Google 代碼 ID,

使用 Square Online 設定 Google 代碼的操作說明,與開頭為「AW-」的代碼 ID (通常是 Google Ads 帳戶) 和開頭為「G-」的代碼 ID (通常是 Google Analytics (分析) 資源)) 不同。

如果代碼開頭為「AW-」

An animation showing how to add new code using Square Online.
  1. 登入 Square 帳戶
  2. 在左側面板選單中,點按「Online」(線上),然後在彈出式選單中,選取「Online」(線上)。
  3. 在「Online」(線上) 頁面上,點按「Settings」(設定),然後從下拉式選單中選取「Tracking Tools」(追蹤工具)。
  4. 在「Add custom header code」(新增自訂標頭程式碼) 列下方,點按「Add new code」(新增程式碼)。
  5. 在「Add custom header code」(新增自訂標頭程式碼) 彈出式視窗中,輸入自訂程式碼的名稱,然後將 Google 代碼貼到「Custom code」(自訂程式碼) 方塊中。

    <!-- Google tag (gtag.js) -->

    <script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>

    <script>

     window.dataLayer = window.dataLayer || [];

     function gtag(){dataLayer.push(arguments);}

     gtag('js', new Date());

     gtag('config', 'TAG_ID');

    </script>

  6. 在「Where would you like to place this code?」(要將這個程式碼安插在哪裡?) 下方,確認程式碼已安插在 <head> 中。
    An illustration showing how to add custom header code using Square Online.
  7. 按一下「Save」(儲存)。

如果代碼開頭為「G-」

An animation showing how to add new code using Square Online.
  1. 登入 Square 帳戶
  2. 在左側面板選單中,點按「Online」(線上),然後在彈出式選單中,選取「Online」(線上)。
  3. 在「Online」(線上) 頁面上,點按「Settings」(設定),然後從下拉式選單中選取「Tracking Tools」(追蹤工具)。
  4. 在「Google Analytics (分析)」下方輸入代碼 ID。系統會自動儲存變更。
    A screenshot showing the tracking tools in Square Online.

這對您有幫助嗎?

我們應如何改進呢?
搜尋
清除搜尋內容
關閉搜尋
主選單
1994685777638641470
true
搜尋說明中心
true
true
true
true
true
102259
false
false