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 = {"3829-0":{"id":"3829","id_product":"3829","id_category_default":"209","id_manufacturer":"99","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS H\u00daMEDAS \u00cdNTIMA POSTDAY SOBRE CON 12 PIEZAS","manufacturer_name":"INVESTIGACION FARMACEUTICA","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501249601926","supplier_reference":"","ean13":"0000000000000","price_amount":17.239999999999998436805981327779591083526611328125},"3837-0":{"id":"3837","id_product":"3837","id_category_default":"209","id_manufacturer":"159","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS ALWAYS D\u00cdA CON ALAS CON 14 PIEZAS","manufacturer_name":"PROCTER & GAMBLE","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7506195179499","supplier_reference":"","ean13":"0000000000000","price_amount":46.2999999999999971578290569595992565155029296875},"3838-0":{"id":"3838","id_product":"3838","id_category_default":"209","id_manufacturer":"159","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS ALWAYS NOCHE CON ALAS CON 10 PIEZAS","manufacturer_name":"PROCTER & GAMBLE","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7506195179512","supplier_reference":"","ean13":"0000000000000","price_amount":43.64999999999999857891452847979962825775146484375},"3839-0":{"id":"3839","id_product":"3839","id_category_default":"209","id_manufacturer":"159","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS ALWAYS NOCHE CON ALAS CON 8 PIEZAS","manufacturer_name":"PROCTER & GAMBLE","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"0056100024798","supplier_reference":"","ean13":"0000000000000","price_amount":24.699999999999999289457264239899814128875732421875},"3842-0":{"id":"3842","id_product":"3842","id_category_default":"209","id_manufacturer":"106","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS ANAT\u00d3MICA CON ALAS CON 10 PIEZAS","manufacturer_name":"KIMBERLY CLARK","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501017360789","supplier_reference":"","ean13":"0000000000000","price_amount":15.9399999999999995026200849679298698902130126953125},"3844-0":{"id":"3844","id_product":"3844","id_category_default":"209","id_manufacturer":"106","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS KOTEX ANAT\u00d3MICA SIN ALAS CON 10 PIEZAS","manufacturer_name":"KIMBERLY CLARK","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501017371198","supplier_reference":"","ean13":"0000000000000","price_amount":17.969999999999998863131622783839702606201171875},"3845-0":{"id":"3845","id_product":"3845","id_category_default":"209","id_manufacturer":"106","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS KOTEX FREE NOCTURNA CON ALAS CON 10 PIEZAS","manufacturer_name":"KIMBERLY CLARK","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501017364558","supplier_reference":"","ean13":"0000000000000","price_amount":26.6099999999999994315658113919198513031005859375},"3846-0":{"id":"3846","id_product":"3846","id_category_default":"209","id_manufacturer":"106","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS KOTEX MANZANILLA ANAT\u00d3MICA CON 10 PIEZAS","manufacturer_name":"KIMBERLY CLARK","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501943424623","supplier_reference":"","ean13":"0000000000000","price_amount":18.879999999999999005240169935859739780426025390625},"3847-0":{"id":"3847","id_product":"3847","id_category_default":"209","id_manufacturer":"106","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS KOTEX MANZANILLA SIN ALAS CON 10 PIEZAS","manufacturer_name":"KIMBERLY CLARK","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501943424609","supplier_reference":"","ean13":"0000000000000","price_amount":17.71000000000000085265128291212022304534912109375},"3848-0":{"id":"3848","id_product":"3848","id_category_default":"209","id_manufacturer":"106","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS KOTEX MAXI CON ALAS CON 10 PIEZAS","manufacturer_name":"KIMBERLY CLARK","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501943411449","supplier_reference":"","ean13":"0000000000000","price_amount":31.85000000000000142108547152020037174224853515625},"3849-0":{"id":"3849","id_product":"3849","id_category_default":"209","id_manufacturer":"106","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS KOTEX NOCTURNA CON ALAS CON 10 PIEZAS","manufacturer_name":"KIMBERLY CLARK","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501943494220","supplier_reference":"","ean13":"0000000000000","price_amount":28.559999999999998721023075631819665431976318359375},"3851-0":{"id":"3851","id_product":"3851","id_category_default":"209","id_manufacturer":"106","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS KOTEX UNIK CON ALAS CON 10 PIEZAS","manufacturer_name":"KIMBERLY CLARK","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501943494268","supplier_reference":"","ean13":"0000000000000","price_amount":26.260000000000001563194018672220408916473388671875},"3854-0":{"id":"3854","id_product":"3854","id_category_default":"209","id_manufacturer":"159","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS NATURELLA FIBRAS ORG\u00c1NICAS SIN ALAS CON 8 PIEZAS","manufacturer_name":"PROCTER & GAMBLE","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501001158439","supplier_reference":"","ean13":"0000000000000","price_amount":19.17999999999999971578290569595992565155029296875},"3855-0":{"id":"3855","id_product":"3855","id_category_default":"209","id_manufacturer":"159","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS NATURELLA MANZANILLA REGULAR CON ALAS CON 32 PIEZAS","manufacturer_name":"PROCTER & GAMBLE","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7500435138635","supplier_reference":"","ean13":"0000000000000","price_amount":63.5799999999999982946974341757595539093017578125},"3856-0":{"id":"3856","id_product":"3856","id_category_default":"209","id_manufacturer":"159","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS NATURELLA NOCTURNA CON ALAS CON 8 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7506339394719","supplier_reference":"","ean13":"0000000000000","price_amount":21.870000000000000994759830064140260219573974609375},"3858-0":{"id":"3858","id_product":"3858","id_category_default":"209","id_manufacturer":"73","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA BUENAS NOCHES CON ALAS CON 24 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501019006692","supplier_reference":"","ean13":"0000000000000","price_amount":78.030000000000001136868377216160297393798828125},"3859-0":{"id":"3859","id_product":"3859","id_category_default":"209","id_manufacturer":"73","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA BUENAS NOCHES CON ALAS CON 8 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501019006623","supplier_reference":"","ean13":"0000000000000","price_amount":31.6099999999999994315658113919198513031005859375},"3860-0":{"id":"3860","id_product":"3860","id_category_default":"209","id_manufacturer":"73","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA BUENAS NOCHES SIN ALAS CON 10 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501019006609","supplier_reference":"","ean13":"0000000000000","price_amount":37.89999999999999857891452847979962825775146484375},"3861-0":{"id":"3861","id_product":"3861","id_category_default":"209","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA CON 1 PIEZA","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"9885661117004","supplier_reference":"","ean13":"9885661117004","price_amount":3.020000000000000017763568394002504646778106689453125},"3862-0":{"id":"3862","id_product":"3862","id_category_default":"209","id_manufacturer":"73","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA CONFORT MANZANILLA DELGADA CON ALAS CON 14 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501019007309","supplier_reference":"","ean13":"0000000000000","price_amount":30.8900000000000005684341886080801486968994140625},"3863-0":{"id":"3863","id_product":"3863","id_category_default":"209","id_manufacturer":"73","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA CONFORT MANZANILLA REGULAR CON ALAS CON 14 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501019007057","supplier_reference":"","ean13":"0000000000000","price_amount":39.25},"3864-0":{"id":"3864","id_product":"3864","id_category_default":"209","id_manufacturer":"73","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA CONFORT MANZANILLA SIN ALAS CON 14 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501019007033","supplier_reference":"","ean13":"0000000000000","price_amount":28.230000000000000426325641456060111522674560546875},"3865-0":{"id":"3865","id_product":"3865","id_category_default":"209","id_manufacturer":"73","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA INVISIBLE CON ALAS ULTRADELGADA CON 10 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501019006296","supplier_reference":"","ean13":"0000000000000","price_amount":30.519999999999999573674358543939888477325439453125},"3866-0":{"id":"3866","id_product":"3866","id_category_default":"209","id_manufacturer":"73","id_product_attribute":"0","cache_default_attribute":"0","name":"TOALLAS SANITARIAS SABA INVISIBLE CON ALAS DELGADA CON 10 PIEZAS","category":"Toallas_y_tampones","category_name":"Toallas y tampones","reference":"7501019006371","supplier_reference":"","ean13":"0000000000000","price_amount":21.9200000000000017053025658242404460906982421875}};
// 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);
}
}