gtag('event', 'Product', { product_category: 'PANTALONES PUNTO ROMA,PANTALONES LARGOS' }); function trackAddToCart_google(productCode, quantityAdded) { gtag('event', 'AddToCart', { product_code: productCode, quantity: quantityAdded }); } window.mediator.subscribe('trackAddToCart', function(data) { if (data.productCode && data.quantity) { trackAddToCart_google(data.productCode, data.quantity); } }); function trackUpdateCart(productCode, initialQuantity, newQuantity) { if (initialQuantity != newQuantity) { if (initialQuantity > newQuantity) { gtag('event', 'RemoveFromCart', { product_code: productCode, quantity: initialQuantity - newQuantity }); } else { gtag('event', 'AddToCart', { product_code: productCode, quantity: newQuantity - initialQuantity }); } } } window.mediator.subscribe('trackUpdateCart', function(data) { if (data.productCode && data.initialCartQuantity && data.newCartQuantity){ trackUpdateCart(data.productCode, data.initialCartQuantity, data.newCartQuantity); } }); function trackRemoveFromCart(productCode, initialQuantity) { gtag('event', 'RemoveFromCart', { product_code: productCode, quantity: parseInt(initialQuantity) }); } window.mediator.subscribe('trackRemoveFromCart', function(data) { if (data.productCode && data.initialCartQuantity){ trackRemoveFromCart(data.productCode, data.initialCartQuantity); } }); function trackSizeInfo(productCode) { gtag('event', 'product', { ViewSizeInfo: productCode }); } window.mediator.subscribe('trackSizeInfo', function(data) { if (data.productCode){ trackSizeInfo(data.productCode); } }); function trackListerPage(lister) { gtag('event', 'category', { four_columns: lister }); } window.mediator.subscribe('trackListerPage', function(data) { if (data.pagePath){ trackListerPage(data.pagePath); } }); function trackChangeGrid(lister) { gtag('event', 'pageview', { pageview: lister }); } window.mediator.subscribe('trackChangeGrid', function(data) { if (data.lister){ trackChangeGrid(data.lister); } }); -->