admin管理员组文章数量:1241097
I'm trying to implement product impressions on a emerce catalog page using google analytics enhanced emerce tracking.
Following the specs one should implement it like this:
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.
Although the specs show a track pageview event. In order to send REAL impressions I wanted to trigger the beacon once the user scrolled down. To do that I've triggered the event through a "lazy loader" which loads gradually the images on the catalog using the event 'ga(send, impression)' but it won't work and if I do that with additional pageviews events I would be corrupting my pageviews metric on GA.
Does anyone have ideas on how to solve that?
I'm trying to implement product impressions on a emerce catalog page using google analytics enhanced emerce tracking.
Following the specs one should implement it like this:
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.
Although the specs show a track pageview event. In order to send REAL impressions I wanted to trigger the beacon once the user scrolled down. To do that I've triggered the event through a "lazy loader" which loads gradually the images on the catalog using the event 'ga(send, impression)' but it won't work and if I do that with additional pageviews events I would be corrupting my pageviews metric on GA.
Does anyone have ideas on how to solve that?
Share Improve this question asked Aug 5, 2014 at 13:54 cmottacmotta 951 silver badge5 bronze badges1 Answer
Reset to default 17From the Enhanced Emerce docs:
Note: Emerce data can only be sent with an existing hit, for example a pageview or event. If you use emerce mands but do not send any hits, or the hit is sent before the emerce mand then the emerce data will not be sent.
Send it with a non-interactive event instead:
ga('send', 'event', 'catalog', 'impression', {'nonInteraction': true});
本文标签: javascriptTracking catalog product impressionsEnhanced Ecommerce Google AnalyticsStack Overflow
版权声明:本文标题:javascript - Tracking catalog product impressions - Enhanced Ecommerce Google Analytics - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739999666a2219517.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论