????在 Shopify 上設置 Google Analytics 4 的方式取決于使用的 Shopify 版本。如果使用的是 Shopify Plus,則可以在 Shopify 商店的所有頁面(包括結賬頁面)上安裝跟蹤代碼(或 Google Tag Manager)。如果使用的是標準版 Shopify,則可以在商店的所有頁面上安裝 Google Analytics,不包括結賬頁面。

      ????要在標準版 Shopify 上安裝 Google Analytics 4,需要按照以下步驟操作。

      1. 將跟蹤代碼添加到Shopify的主題

      ????導航到“在線商店”,然后是“主題”,然后編輯 theme.liquid 文件。然后,您需要將跟蹤代碼粘貼到 head 標簽之間。下面是代碼示例(重要提示:需要用 GA4 數據流中的測量 ID 替換 G-EXAMPLE 的兩個實例):

      <!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=G-EXAMPLE"></script><script>  window.dataLayer = window.dataLayer || [];  function gtag()  gtag('js', new Date());  gtag('config', 'G-EXAMPLE');</script>

      2. 將跟蹤代碼添加到您的訂單確認頁面

      ????導航到“設置”,然后“結賬&賬目”,將修改后的跟蹤代碼添加到“其他腳本”部分(在“訂單狀態頁面”下)。這是您可以使用的示例(重要:需要替換 G 的兩個實例 - 使用 GA4 數據流中的測量 ID 的示例):

      <!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=G-EXAMPLE"></script><script>  window.dataLayer = window.dataLayer || [];  function gtag(){dataLayer.push(arguments);}  gtag('js', new Date());  gtag('config', 'G-EXAMPLE');{% if first_time_accessed %}gtag("event", "purchase", {????'send_to':?'G-EXAMPLE',    transaction_id: "{{ order.order_number }}",    value: {{ total_price | times: 0.01 }},    tax: {{ tax_price | times: 0.01 }},    shipping: {{ shipping_price | times: 0.01 }},    currency: "{{ order.currency }}",    items: [     {% for line_item in line_items %}     {      item_id: "{{ line_item.product_id }}",      item_name: "{{ line_item.title | remove: "'" | remove: '"' }}",      currency: "{{ order.currency }}",      price: {{ line_item.original_price | times: 0.01 }},      quantity: {{ line_item.quantity }}    },    {% endfor %}    ]});{% endif %}</script>

      3. 在 GA4 中排除 SHOPIFY 作為推薦

      ????為確保銷售歸因于正確的營銷渠道,需要防止 Shopify 結賬頁面在報告中顯示為推薦。為此,請在 Google Analytics 中打開數據流,然后選擇“更多標記設置”并選擇“列出不需要的推薦”。然后需要輸入 myshopify.com 作為排除項。

      具體步驟:

      1. 在 Admin 中,單擊 Property 列中的 Data Streams

      2. 單擊 Web,然后單擊 Web 數據流

      3. ?Web 數據流詳細信息中,單擊配置標簽設置(位于底部)。

      4. 在“設置”部分中,單擊“全部顯示”以查看所有可用設置。

      5. 單擊“列出不需要的引薦”。

      6. 在包括符合以下任何條件的引薦下:

        1. 選擇匹配

          類型。????

        2. 在域名下,輸入您要匹配的域的標識符(例如 example.com)。


        3. 添加條件以添加另一個域。

          ? 使用 OR 邏輯評估條件。

      7. 單擊保存。

      4. 添加Universal Analytics屬性 ID

      ????由于無法看到人們在 GA4 中瀏覽結賬頁面,建議將 Universal Analytics 添加到 Shopify 商店。為此,導航至“在線商店”,然后導航至“首選項”,并在“Google Analytics”下添加資產 ID。


      點贊(2) 打賞

      評論列表 共有 0 條評論

      暫無評論

      服務號

      訂閱號

      備注【拉群】

      商務洽談

      微信聯系站長

      發表
      評論
      立即
      投稿
      返回
      頂部