我正在尝试使用 google analytics enhanced ecommerce 在电子商务目录页面上实现产品印象跟踪。
按照规范,应该像这样实现它:
ga('create', 'UA-XXXXX-Y');
ga('require', 'ec');
ga('ec:addImpression', {
'id': 'P12345', // Product details are provided in an impressionFieldObject.
'name': 'Android Warhol T-Shirt',
'category': 'Apparel/T-Shirts',
'brand': 'Google',
'variant': 'black',
'list': 'Search Results',
'position': 1 // 'position' indicates the product position in the list.
});
ga('ec:addImpression', {
'id': 'P67890',
'name': 'YouTube Organic T-Shirt',
'type': 'view',
'category': 'Apparel/T-Shirts',
'brand': , 'YouTube',
'variant': 'gray',
'list': 'Search Results',
'position': 2
});
ga('send', 'pageview'); // Send product impressions with initial pageview.
尽管规范显示了跟踪页面浏览事件。为了发送真实的印象,我想在用户向下滚动时触发信标。为此,我通过“延迟加载程序”触发了事件,该加载程序使用事件“ga(发送,印象)”逐渐加载目录中的图像,但它不会起作用,如果我使用其他页面浏览事件执行此操作,我会破坏我在 GA 上的综合浏览量指标。
有没有人知道如何解决这个问题?
最佳答案
Note: Ecommerce data can only be sent with an existing hit, for example a pageview or event. If you use ecommerce commands but do not send any hits, or the hit is sent before the ecommerce command then the ecommerce data will not be sent.
用 non-interactive 发送它事件代替:
ga('发送', '事件', '目录', '印象', {'nonInteraction': true});
关于javascript - 跟踪目录产品印象 - 增强型电子商务 Google Analytics,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25140579/