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 = {"461-0":{"id":"461","id_product":"461","id_category_default":"211","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"BENZAL JAB\u00d3N L\u00cdQUIDO DE 240 ML CUIDADO PH WASH","category":"Jabon_Intimo","category_name":"Jab\u00f3n \u00cdntimo","reference":"7501080160514","supplier_reference":"","ean13":"7501080160514","price_amount":68.5},"2062-0":{"id":"2062","id_product":"2062","id_category_default":"211","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N \u00cdNTIMO SABA DIARIOS CUIDADO V CON 200 ML","category":"Jabon_Intimo","category_name":"Jab\u00f3n \u00cdntimo","reference":"7501019037993","supplier_reference":"","ean13":"7501019037993","price_amount":65.4200000000000017053025658242404460906982421875},"2801-0":{"id":"2801","id_product":"2801","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTI PROTECTORES KOTEX REGULAR O TANGA CON 22 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501943431317","supplier_reference":"","ean13":"7501943431317","price_amount":15.53999999999999914734871708787977695465087890625},"2802-0":{"id":"2802","id_product":"2802","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTI PROTECTORES SABA LARGO CON 28 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501019068911","supplier_reference":"","ean13":"7501019068911","price_amount":25.469999999999998863131622783839702606201171875},"2803-0":{"id":"2803","id_product":"2803","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTI PROTECTORES SABA REGULAR CON 28 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501019068515","supplier_reference":"","ean13":"7501019068515","price_amount":23.589999999999999857891452847979962825775146484375},"2804-0":{"id":"2804","id_product":"2804","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTI PROTECTORES TENA LADY NOCTURNAS CON 8 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501019051104","supplier_reference":"","ean13":"7501019051104","price_amount":61.75999999999999801048033987171947956085205078125},"2805-0":{"id":"2805","id_product":"2805","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTI PROTECTORES TENA LADY NORMAL CON 10 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501019050022","supplier_reference":"","ean13":"7501019050022","price_amount":39.50999999999999801048033987171947956085205078125},"2807-0":{"id":"2807","id_product":"2807","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTIPROTECTORES KOTEX CONTROL CON 22 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501943431249","supplier_reference":"","ean13":"7501943431249","price_amount":16.719999999999998863131622783839702606201171875},"2808-0":{"id":"2808","id_product":"2808","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTIPROTECTORES KOTEX MANZANILLA CON 44 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501943431102","supplier_reference":"","ean13":"7501943431102","price_amount":28.280000000000001136868377216160297393798828125},"2809-0":{"id":"2809","id_product":"2809","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTIPROTECTORES KOTEX REGULAR O TANGA CON 44 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501943431140","supplier_reference":"","ean13":"7501943431140","price_amount":28.949999999999999289457264239899814128875732421875},"2816-0":{"id":"2816","id_product":"2816","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTY PROTECTORES NATURELLA CON 40 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7590002046234","supplier_reference":"","ean13":"7590002046234","price_amount":29.67999999999999971578290569595992565155029296875},"2817-0":{"id":"2817","id_product":"2817","id_category_default":"210","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PANTY PROTECTORES SABA DOBLES MULTI ESTILOS CON 25 PIEZAS","category":"Pantiprotectores","category_name":"Pantiprotectores","reference":"7501036623377","supplier_reference":"","ean13":"7501036623377","price_amount":33.280000000000001136868377216160297393798828125},"3370-0":{"id":"3370","id_product":"3370","id_category_default":"211","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"SHAMPO \u00cdNTIMO LOMECAN PIEL SENSIBLE CON 200 ML","category":"Jabon_Intimo","category_name":"Jab\u00f3n \u00cdntimo","reference":"0650240032400","supplier_reference":"","ean13":"0650240032400","price_amount":60.3299999999999982946974341757595539093017578125},"3397-0":{"id":"3397","id_product":"3397","id_category_default":"211","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"SHAMPOO \u00cdNTIMO CANDIFLUX ANTIBACTERIAL CON 250 ML","category":"Jabon_Intimo","category_name":"Jab\u00f3n \u00cdntimo","reference":"8056736700129","supplier_reference":"","ean13":"8056736700129","price_amount":36.4500000000000028421709430404007434844970703125},"3399-0":{"id":"3399","id_product":"3399","id_category_default":"211","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"SHAMPOO \u00cdNTIMO LACTACYD F\u00c9MINA FLORAL CON 200 ML","category":"Jabon_Intimo","category_name":"Jab\u00f3n \u00cdntimo","reference":"7501165009486","supplier_reference":"","ean13":"7501165009486","price_amount":63.36999999999999744204615126363933086395263671875},"3401-0":{"id":"3401","id_product":"3401","id_category_default":"211","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"SHAMPOO \u00cdNTIMO LOMECAN ACLARANTE CON 200 ML","category":"Jabon_Intimo","category_name":"Jab\u00f3n \u00cdntimo","reference":"0650240030338","supplier_reference":"","ean13":"0650240030338","price_amount":63.93999999999999772626324556767940521240234375},"3403-0":{"id":"3403","id_product":"3403","id_category_default":"211","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"SHAMPOO \u00cdNTIMO LOMECAN FRESCO CON 200 ML","category":"Jabon_Intimo","category_name":"Jab\u00f3n \u00cdntimo","reference":"0650240025839","supplier_reference":"","ean13":"0650240025839","price_amount":49.57000000000000028421709430404007434844970703125},"3404-0":{"id":"3404","id_product":"3404","id_category_default":"211","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"SHAMPOO \u00cdNTIMO LOMECAN INHIBIDOR DEL VELLO CON 200 ML","category":"Jabon_Intimo","category_name":"Jab\u00f3n \u00cdntimo","reference":"0650240032417","supplier_reference":"","ean13":"0650240032417","price_amount":64.3700000000000045474735088646411895751953125},"3698-0":{"id":"3698","id_product":"3698","id_category_default":"209","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TAMPAX PEARL SUPER CON 8 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7506295369387","supplier_reference":"","ean13":"7506295369387","price_amount":39.8599999999999994315658113919198513031005859375},"3829-0":{"id":"3829","id_product":"3829","id_category_default":"209","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS H\u00daMEDAS \u00cdNTIMA POSTDAY SOBRE CON 12 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501249601926","supplier_reference":"","ean13":"7501249601926","price_amount":17.239999999999998436805981327779591083526611328125},"3837-0":{"id":"3837","id_product":"3837","id_category_default":"209","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS ALWAYS D\u00cdA CON ALAS CON 14 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7506195179499","supplier_reference":"","ean13":"7506195179499","price_amount":46.11999999999999744204615126363933086395263671875},"3838-0":{"id":"3838","id_product":"3838","id_category_default":"209","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS ALWAYS NOCHE CON ALAS CON 10 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7506195179512","supplier_reference":"","ean13":"7506195179512","price_amount":43.64999999999999857891452847979962825775146484375},"3839-0":{"id":"3839","id_product":"3839","id_category_default":"209","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS ALWAYS NOCHE CON ALAS CON 8 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"0056100024798","supplier_reference":"","ean13":"0056100024798","price_amount":24.699999999999999289457264239899814128875732421875},"3842-0":{"id":"3842","id_product":"3842","id_category_default":"209","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS ANAT\u00d3MICA CON ALAS CON 10 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501017360789","supplier_reference":"","ean13":"7501017360789","price_amount":15.9399999999999995026200849679298698902130126953125}};
// 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);
}
}