簡體   English   中英

Google Analytics(分析)(gtag.js):產品列表名稱未顯示,但其他字段顯示

[英]Google Analytics (gtag.js): Product List Name doesn't appear but other fields do

我正在使用新的gtag.js庫實施GA增強型電子商務。 我想按照以下文檔發送有關產品印象和產品點擊的信息: https : //developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce

一切正常(我可以在GA中看到數據), 產品列表名稱除外

文檔在命名屬性時似乎不一致(有時將其稱為"list" ,有時也稱為"list_name" ),但它們都不適合我。

這是我的(簡化)代碼:

 deals = [ { "id": "18", "name": "Some product", "list": "All Deals", // also tried "list_name" here "category": "Multiplatform", "list_position": "1", "price": "18,39", "currency": "EUR", "product_url": "https://www.amazon.com/someproduct", }, ... ] ... // on page load gtag('event', 'view_item_list', { "items": deals }); ... // on click gtag('event', 'select_content', { "content_type": "product", "items": [ deals[0] ] }); 

所有數據都成功進入了GA,但是無論如何,產品列表名稱都會顯示(not set)

在此處輸入圖片說明

感謝您提供有關如何解決/調試此問題的想法!

gtag文檔中存在錯誤/錯誤/不一致:

  • 您應該使用list_name而不是list

它可以按預期與list_name


!!! 不要使用 gtag因為它不會發送帶有select_contentview_item事件的list_name

簡而言之,使用gtag時,不包括用於通過gtag進行collect呼叫的查詢參數pal (產品操作列表)-與analytics.js實施相比,這是一個主要錯誤。

從任何列表添加到購物車時,您可以發送2個事件:

gtag('event','view_item',deals); gtag('event','add_to_cart',deals);

列表名稱必須在list_name中設置。

deals = [{"id": "18","name": "Some product","list_name": "All Deals", ...}]

然后工作正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM