Square Online:設定 Google 代碼

您可以使用 Google Ads 和 Google Analytics (分析) 評估網站上的使用行為資料。請按照本文中的步驟,為 Google Ads 或 Google Analytics (分析) 帳戶設定代碼。進一步瞭解如何使用網站製作工具或 CMS 加入代碼

事前準備

您必須擁有 Google 代碼 ID,
 
設定 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. 按一下「儲存」

如果代碼開頭為「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」(Google Analytics (分析)) 下方輸入代碼 ID。系統會自動儲存變更。
    A screenshot showing the tracking tools in Square Online.

這對您有幫助嗎?

我們應如何改進呢?
true
Achieve your advertising goals today!

Attend our Performance Max Masterclass, a livestream workshop session bringing together industry and Google ads PMax experts.

Register now

搜尋
清除搜尋內容
關閉搜尋
主選單
3996305017808821861
true
搜尋說明中心
true
true
true
true
true
73067
false
false
false