Utilizamos cookies para mejorar su experiencia de compra. Usted podrá seleccionar las cookies nuestra y de terceros que desea utilizar en cualquier momento.
// Instantiate the tracking class
var rcAnalyticsEvents = new RcAnalyticsEvents();
// page controller
var controllerName = 'category';
var compliantModules = {"default":"order","supercheckout":"supercheckout","onepagecheckoutps":"order","sveacheckout":"sveapaypage","thecheckout":"order","steasycheckout":"default"};
var compliantModuleName = 'default';
var skipCartStep = '';
var isOrder = '';
var isCheckout = '';
var isClientId = 0;
var gaOrder;
var gaProducts;
////////////////////////////
// set tracking features
rcAnalyticsEvents.trackingFeatures = {"analyticsId":"UA-206850117-1","adwordsId":"AW-304797200","adwordsCl":"e5L_CMKU0_YCEJCsq5EB","productSendRate":10,"merchantPrefix":"","merchantSuffix":"","merchantVariant":"","businessDataPrefix":"","businessDataVariant":"","currency":"MXN","idShop":1,"productsPerPage":24,"cartAjax":1,"token":"a9b86829a7a41e60e7b65f79b9b5e76d","disableInternalTracking":false,"signUpTypes":["new customer","guest customer"],"isNewSignUp":false,"isGuest":0,"checkDoNotTrack":1,"config":{"optimizeId":"","simpleSpeedSampleRate":1,"anonymizeIp":1,"linkAttribution":1,"userIdFeature":1,"userIdValue":null,"remarketing":1,"crossDomainList":"","clientId":0,"businessData":0,"customDimensions":{"ecommProdId":3,"ecommPageType":4,"ecommTotalValue":5,"ecommCategory":6,"dynxItemId":5,"dynxItemId2":6,"dynxPageType":7,"dynxTotalValue":8}},"goals":{"signUp":1,"socialAction":1},"eventValues":{"signUp":0,"socialAction":0}};
// set checkout values
rcAnalyticsEvents.controllerName = controllerName;
rcAnalyticsEvents.isCheckout = isCheckout;
rcAnalyticsEvents.compliantModuleName = compliantModuleName;
rcAnalyticsEvents.skipCartStep = skipCartStep;
// list names
rcAnalyticsEvents.lists = {"default":"category","filter":"filtered_results"};
// Google remarketing - page type
rcAnalyticsEvents.ecommPageType = 'category';
// get products list to cache
rcAnalyticsEvents.productsListCache = {"1416-0":{"id":"1416","id_product":"1416","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ENFAGROW 3 PREMUIM SABOR VAINILLA CON 800 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7506205805370","supplier_reference":"","ean13":"7506205805370","price_amount":267.81000000000000227373675443232059478759765625},"1417-0":{"id":"1417","id_product":"1417","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ENFAGROW ETAPA 3 PREMIUM CON 375 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7503013040016","supplier_reference":"","ean13":"7503013040016","price_amount":159.6299999999999954525264911353588104248046875},"1418-0":{"id":"1418","id_product":"1418","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ENFAGROW ETAPA 3 PREMIUM CON 800 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7506205805363","supplier_reference":"","ean13":"7506205805363","price_amount":284.3700000000000045474735088646411895751953125},"1419-0":{"id":"1419","id_product":"1419","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ENFAGROW ETAPA 3 PREMIUM SABOR VAINILLA CON 375 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7506205809279","supplier_reference":"","ean13":"7506205809279","price_amount":164.840000000000003410605131648480892181396484375},"1420-0":{"id":"1420","id_product":"1420","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ENFAMIL CONFORT PREMIUM DE 0 A 12 MESES CON 375 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7506205810039","supplier_reference":"","ean13":"7506205810039","price_amount":263.970000000000027284841053187847137451171875},"1421-0":{"id":"1421","id_product":"1421","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ENFAMIL ETAPA 1 PREMIUM CON 800 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7506205809316","supplier_reference":"","ean13":"7506205809316","price_amount":370},"2620-0":{"id":"2620","id_product":"2620","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NAN 1 OPTIPRO CONFORTIS CON 720 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7501058625212","supplier_reference":"","ean13":"7501058625212","price_amount":275.81000000000000227373675443232059478759765625},"2622-0":{"id":"2622","id_product":"2622","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NAN 1 OPTIPRO DE 0 A 6 MESES LATA CON 800 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7501059235298","supplier_reference":"","ean13":"7501059235298","price_amount":251.25},"2624-0":{"id":"2624","id_product":"2624","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NAN 2 OPTIPRO DE 6 A 12 MESES CON 400 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7501059224711","supplier_reference":"","ean13":"7501059224711","price_amount":151.340000000000003410605131648480892181396484375},"2626-0":{"id":"2626","id_product":"2626","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NAN SIN LACTOSA CON 400 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7616100001033","supplier_reference":"","ean13":"7616100001033","price_amount":337.6299999999999954525264911353588104248046875},"2718-0":{"id":"2718","id_product":"2718","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NOVAMIL AC ETAPA 1 DE 0 A 6 MESES CON 400 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7501318628434","supplier_reference":"","ean13":"7501318628434","price_amount":223.770000000000010231815394945442676544189453125},"2719-0":{"id":"2719","id_product":"2719","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NOVAMIL AE ETAPA 1 DE 0 A 6 MESES CON 800 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7501318605794","supplier_reference":"","ean13":"7501318605794","price_amount":491.6100000000000136424205265939235687255859375},"2721-0":{"id":"2721","id_product":"2721","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NOVAMIL AE ETAPA 2 DE 6 A 12 MESES CON 800 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7501318605602","supplier_reference":"","ean13":"7501318605602","price_amount":479.58999999999997498889570124447345733642578125},"3022-0":{"id":"3022","id_product":"3022","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PRE NAN CON 400 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7613031893003","supplier_reference":"","ean13":"7613031893003","price_amount":213.710000000000007958078640513122081756591796875},"3098-0":{"id":"3098","id_product":"3098","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PROGRESS GOLD ETAPA 3 DE 1 A 3 A\u00d1OS CON 400 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7501108765349","supplier_reference":"","ean13":"7501108765349","price_amount":158.6200000000000045474735088646411895751953125},"3099-0":{"id":"3099","id_product":"3099","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PROGRESS GOLD ETAPA 3 DE 1 A 3 A\u00d1OS CON 900 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7501108765332","supplier_reference":"","ean13":"7501108765332","price_amount":289.08999999999997498889570124447345733642578125},"3501-0":{"id":"3501","id_product":"3501","id_category_default":"217","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"SMA COMFORT GOLD DE 0 A 12 MESES CON 900 G","category":"Formulas_infantiles","category_name":"Formulas infantiles","reference":"7502253072221","supplier_reference":"","ean13":"7502253072221","price_amount":615.3200000000000500222085975110530853271484375},"10151-0":{"id":"10151","id_product":"10151","id_category_default":"2","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"FRISO GOLD COMFORT NEXT 1-3 A\u00d1OS 400G","category":"inicio","category_name":"Inicio","reference":"8716200736350","supplier_reference":"","ean13":"8716200736350","price_amount":202.80000000000001136868377216160297393798828125},"10152-0":{"id":"10152","id_product":"10152","id_category_default":"2","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"FRISO GOLD ETAPA 3 DE 1 A 3 A\u00d1OS CON 800 G","category":"inicio","category_name":"Inicio","reference":"8716200727655","supplier_reference":"","ean13":"8716200727655","price_amount":281.91000000000002501110429875552654266357421875},"10154-0":{"id":"10154","id_product":"10154","id_category_default":"2","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NOVAMIL RICE F\u00d3RMULA NO L\u00c1CTEA 0-3 A\u00d1OS CON 400 G","category":"inicio","category_name":"Inicio","reference":"7501318663954","supplier_reference":"","ean13":"7501318663954","price_amount":419.8700000000000045474735088646411895751953125},"10156-0":{"id":"10156","id_product":"10156","id_category_default":"2","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"FRISOLAC GOLD COMFORT DE 0 A 12 MESES CON 800 G","category":"inicio","category_name":"Inicio","reference":"8716200728614","supplier_reference":"","ean13":"8716200728614","price_amount":494.05000000000001136868377216160297393798828125},"10157-0":{"id":"10157","id_product":"10157","id_category_default":"2","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"FRISOLAC GOLD ETAPA 1 DE 0 A 6 MESES CON 400 G","category":"inicio","category_name":"Inicio","reference":"8716200727518","supplier_reference":"","ean13":"8716200727518","price_amount":209.18000000000000682121026329696178436279296875},"10194-0":{"id":"10194","id_product":"10194","id_category_default":"2","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NAN 3 OPTIPRO DE 1 A 3 A\u00d1OS CON 800 G","category":"inicio","category_name":"Inicio","reference":"7501058623294","supplier_reference":"","ean13":"7501058623294","price_amount":227.840000000000003410605131648480892181396484375},"10200-0":{"id":"10200","id_product":"10200","id_category_default":"2","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"NIDO KINDER DESLACTOSADA DE 1 A 3 A\u00d1OS CON 1.5 KG","category":"inicio","category_name":"Inicio","reference":"7501058626110","supplier_reference":"","ean13":"7501058626110","price_amount":272.20999999999997953636921010911464691162109375}};
// Listing products
/////////////////////////////////
// init gtag
rcAnalyticsEvents.sendGtagConfig('analyticsId');
rcAnalyticsEvents.sendGtagConfig('adwordsId');
///////////////////////////////////////////////
// Initialize all user events when DOM ready
document.addEventListener('DOMContentLoaded', initTrackingEvents, false);
window.addEventListener('pageshow', fireEventsOnPageShow, false);
///////////////////////////////////////////////
function initTrackingEvents() {
// Events binded on all pages
// Events binded to document.body to avoid firefox fire events on right/central click
document.body.addEventListener('click', rcAnalyticsEvents.eventClickPromotionItem, false);
// bind prestashop events with tracking events
prestashop.on(
'updateCart',
function (event) {
rcAnalyticsEvents.eventAddCartProduct(event);
}
);
prestashop.on(
'clickQuickView',
function (event) {
rcAnalyticsEvents.eventProductView(event)
}
);
prestashop.on(
'updatedProduct',
function (event) {
rcAnalyticsEvents.eventProductView(event)
}
);
if (!isCheckout && !isOrder) {
// init first scroll action for those products all ready visible on screen
rcAnalyticsEvents.eventScrollList();
// bind event to scroll
window.addEventListener('scroll', rcAnalyticsEvents.eventScrollList, false);
// init Event Listeners
document.body.addEventListener('click', rcAnalyticsEvents.eventClickProductList, false);
document.body.addEventListener('click', rcAnalyticsEvents.eventGetAddCartQuantity, false);
if (rcAnalyticsEvents.trackingFeatures.goals.socialAction) {
document.body.addEventListener('click', rcAnalyticsEvents.eventSocialShareProductView, false);
}
////////////////////////
// SEARCH PAGE
if (controllerName === 'search') {
rcAnalyticsEvents.onSearchResults();
}
////////////////////////
// PRODUCT PAGE
if (controllerName === 'product') {
// send product detail view
rcAnalyticsEvents.eventProductView();
}
}
////////////////////////
// CHECKOUT PROCESS
if (isCheckout) {
// SUMMARY CART
if (controllerName === 'cart') {
// events on summary Cart
document.body.addEventListener('click', rcAnalyticsEvents.eventCartQuantityDelete, false);
document.body.addEventListener('click', rcAnalyticsEvents.eventCartQuantityUp, false);
document.body.addEventListener('click', rcAnalyticsEvents.eventCartQuantityDown, false);
}
////////////////////////
// CHECKOUT
if (compliantModuleName === 'default' && controllerName === 'order') {
// Events on Checkout Process
document.body.addEventListener('click', rcAnalyticsEvents.eventPrestashopCheckout, false);
} else if (
compliantModuleName === 'supercheckout'
&& controllerName === compliantModules[compliantModuleName]
) {
// Compatible with super-checkout by Knowband
document.body.addEventListener('click', rcAnalyticsEvents.eventOpcSuperCheckout, false);
document.body.addEventListener('click', rcAnalyticsEvents.eventCartOpcSuperCheckout, false);
} else if (
compliantModuleName === 'onepagecheckoutps'
&& controllerName === compliantModules[compliantModuleName]
) {
// compatible with OPC by PrestaTeamShop
document.body.addEventListener('click', rcAnalyticsEvents.eventOpcPrestaTeam, false);
document.body.addEventListener('click', rcAnalyticsEvents.eventCartOpcPrestaTeam, false);
} else if (
compliantModuleName === 'thecheckout'
&& controllerName === compliantModules[compliantModuleName]
) {
// Compatible with thecheckout by Zelarg
document.body.addEventListener('click', rcAnalyticsEvents.eventOpcTheCheckout, false);
document.body.addEventListener('click', rcAnalyticsEvents.eventCartOpcTheCheckout, false);
} else if (
compliantModuleName === 'steasycheckout'
&& controllerName === compliantModules[compliantModuleName]
) {
// Events for steasycheckout
document.body.addEventListener('click', rcAnalyticsEvents.eventOpcStEasyCheckout, false);
document.body.addEventListener('click', rcAnalyticsEvents.eventCartOpcStEasyCheckout, false);
}
}
}
function fireEventsOnPageShow(event){
// fixes safari back cache button
if (event.persisted) {
window.location.reload()
}
// Sign up feature
if (rcAnalyticsEvents.trackingFeatures.goals.signUp && rcAnalyticsEvents.trackingFeatures.isNewSignUp) {
rcAnalyticsEvents.onSignUp();
}
if (isClientId) {
rcAnalyticsEvents.setClientId();
}
// Checkout and order complete
if (isCheckout && gaProducts) {
rcAnalyticsEvents.onCheckoutProducts(gaProducts);
} else if (isOrder && gaOrder && gaProducts) {
rcAnalyticsEvents.onAddOrder(gaOrder, gaProducts, rcAnalyticsEvents.trackingFeatures.idShop);
}
}