From a Google Analytics perspective, it may be helpful to refer to their Enhanced Ecommerce documentation: https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#product-impression A Product Impression is defined as viewing one (or usually multiple) product offers on a given page. A typical scenario would be loading a page on which multiple products in a given category are being browsed. Each of the different product offers on this page would count as a Product Impression. You can send all of the products in the impression list hit to Google Analytics, or you could use a Javascript Extension such as the example below to send impression tracking hits as a user scrolls down into a category page. This code sample assumes that you've set up your utag_data data layer mappings and that you're using the Ecommerce Extension in Tealium. // #3: if a product qualifies as an impression, trigger a utag tracking call to track an impression on that product.
checkProductPositions = function () {
try {
var $productElements = $([]);
var impressionsAdded = false,
productsViewed = [];
// select all product element items on the page.
$productElements = $("div.products");
$productElements.each(function (index) {
// check to see if the element is in the browser viewport.
// check to see if we haven't sent an impression hit for that product.
if (isElementVisible($(this)) && typeof ($(this).data('ecomm_impression')) == "undefined") {
if (typeof window.utag_data._cprodname == 'undefined') {
window.utag_data._cprodname = new Array();
}
if (typeof window.utag_data._ccat == 'undefined') {
window.utag_data._ccat = new Array();
}
// gather the product information from visible product element.
// there are many ways to do this - choose the one that makes the most sense
// for your implementation.
window.utag_data._cprodname.push(""); // product name
window.utag_data._ccat.push(""); // product category
// ..etc.
if (window.utag_data._cprodname.length > 0) {
// we have new product impressions to sent to tag management.
impressionsAdded = true;
// mark each product on the page as having been viewed so that we don't
// resend an impression for a product that has already sent an impression.
$(this).data('ecomm_impression', 'sent');
}
}
});
if (impressionsAdded) {
// send utag.link call with utag_data for the impression hit.
// this example will trigger the Google Analytics event and a Enhanced Ecommerce impression list
// in our implementation. this is dependant on how you've mapped your utag_data variables.
utag.link({
event_name: "Product Impression",
event_action: "Category Page",
event_category: "eCommerce Event",
event_nonInteraction: true,
_cprodname: window.utag_data._cprodname,
_ccat: window.utag_data._ccat
});
}
} catch (e) {;
}
};
// #2: check for new products every 3 seconds.
setProductCheck = function () {
window.setInterval(function () {
if (typeof (this.checkProductTimeoutId) == "number") {
clearTimeout(this.checkProductTimeoutId);
}
this.checkProductTimeoutId = setTimeout(checkProductPositions, 300);
}, 3000);
};
// #1: as user scrolls down the page, check for new products.
window.onscroll = function () {
setProductCheck();
}
... View more