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 = {"3663-0":{"id":"3663","id_product":"3663","id_category_default":"175","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO AMMENS ALOE VERA CON 250 G","category":"Talcos","category_name":"Talcos","reference":"7502221182242","supplier_reference":"","ean13":"7502221182242","price_amount":45.46000000000000085265128291212022304534912109375},"2043-0":{"id":"2043","id_product":"2043","id_category_default":"168","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N CAMAY CL\u00c1SICO CON 150 G","category":"Jabon_de_tocador","category_name":"Jab\u00f3n de tocador","reference":"7501006713381","supplier_reference":"","ean13":"7501006713381","price_amount":15.089999999999999857891452847979962825775146484375},"1502-0":{"id":"1502","id_product":"1502","id_category_default":"173","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ESTROPAJO DE TELA EXFOLIANTE ADULTO T-TAIO","category":"Accesorios_para_la_ducha","category_name":"Accesorios para la ducha","reference":"7501103300224","supplier_reference":"","ean13":"7501103300224","price_amount":21.559999999999998721023075631819665431976318359375},"1153-0":{"id":"1153","id_product":"1153","id_category_default":"171","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"DESODORANTE EN AEROSOL MAJA CON 130 ML","category":"Desodorantes_y_antitranspirantes_para_mujer","category_name":"Desodorantes y antitranspirantes para mujer","reference":"7501046109465","supplier_reference":"","ean13":"7501046109465","price_amount":59.64999999999999857891452847979962825775146484375},"1142-0":{"id":"1142","id_product":"1142","id_category_default":"170","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"DESODORANTE EN AEROSOL AXE APOLLO CON 150 ML","category":"Desodorantes_y_antitranspirantes_para_hombre","category_name":"Desodorantes y antitranspirantes para hombre","reference":"7791293025780","supplier_reference":"","ean13":"7791293025780","price_amount":46.77000000000000312638803734444081783294677734375},"989-0":{"id":"989","id_product":"989","id_category_default":"169","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"CREMA DOVE DELICIOUS CARE COCO DE 400 ML","category":"Crema_corporal","category_name":"Crema corporal","reference":"7506306202320","supplier_reference":"","ean13":"7506306202320","price_amount":67.7699999999999960209606797434389591217041015625},"536-0":{"id":"536","id_product":"536","id_category_default":"172","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"BLOQUEADOR SOLAR NIVEA SUN KIDS FPS 50+ CON 150 ML","category":"Bloqueadores_y_bronceadores","category_name":"Bloqueadores y bronceadores","reference":"4005808944385","supplier_reference":"","ean13":"4005808944385","price_amount":181.55000000000001136868377216160297393798828125},"3666-0":{"id":"3666","id_product":"3666","id_category_default":"175","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO AMMENS FRESCO AROMA CON 125 G","category":"Talcos","category_name":"Talcos","reference":"7502221182167","supplier_reference":"","ean13":"7502221182167","price_amount":26.280000000000001136868377216160297393798828125},"2052-0":{"id":"2052","id_product":"2052","id_category_default":"173","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N ESPONJAB\u00d3N T-TAIO ACLARANTE CON CONCHA NACAR","category":"Accesorios_para_la_ducha","category_name":"Accesorios para la ducha","reference":"7501103305854","supplier_reference":"","ean13":"7501103305854","price_amount":22.629999999999999005240169935859739780426025390625},"1154-0":{"id":"1154","id_product":"1154","id_category_default":"171","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"DESODORANTE EN AEROSOL NIVEA DAMA BEAUTY TOUCH CON 150 ML","category":"Desodorantes_y_antitranspirantes_para_mujer","category_name":"Desodorantes y antitranspirantes para mujer","reference":"4005808630660","supplier_reference":"","ean13":"4005808630660","price_amount":61.3599999999999994315658113919198513031005859375},"1143-0":{"id":"1143","id_product":"1143","id_category_default":"170","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"DESODORANTE EN AEROSOL AXE APOLLO CON 152 ML","category":"Desodorantes_y_antitranspirantes_para_hombre","category_name":"Desodorantes y antitranspirantes para hombre","reference":"7791293020297","supplier_reference":"","ean13":"7791293020297","price_amount":51.8900000000000005684341886080801486968994140625},"990-0":{"id":"990","id_product":"990","id_category_default":"169","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"CREMA DOVE NUTRICI\u00d3N INTENSIVA DE 200 ML","category":"Crema_corporal","category_name":"Crema corporal","reference":"7501056346188","supplier_reference":"","ean13":"7501056346188","price_amount":36.36999999999999744204615126363933086395263671875},"3668-0":{"id":"3668","id_product":"3668","id_category_default":"175","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO AMMENS FRESH CON 60 G","category":"Talcos","category_name":"Talcos","reference":"7502221184444","supplier_reference":"","ean13":"7502221184444","price_amount":23.53999999999999914734871708787977695465087890625},"3113-0":{"id":"3113","id_product":"3113","id_category_default":"172","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"PROTECTOR SOLAR NIVEA SUN KIDS FPS 50+ CON 125 ML","category":"Bloqueadores_y_bronceadores","category_name":"Bloqueadores y bronceadores","reference":"4005808944200","supplier_reference":"","ean13":"4005808944200","price_amount":133.80000000000001136868377216160297393798828125},"2332-0":{"id":"2332","id_product":"2332","id_category_default":"174","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"LOCI\u00d3N REFRESCANTE A\u00d1EJA LAVANDA CON 110 ML","category":"Fragancias","category_name":"Fragancias","reference":"7501046161043","supplier_reference":"","ean13":"7501046161043","price_amount":56.74000000000000198951966012828052043914794921875},"1155-0":{"id":"1155","id_product":"1155","id_category_default":"171","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"DESODORANTE EN AEROSOL NIVEA DAMA BLACK&WHITE INVISIBLE CON 150 ML","category":"Desodorantes_y_antitranspirantes_para_mujer","category_name":"Desodorantes y antitranspirantes para mujer","reference":"4005900036643","supplier_reference":"","ean13":"4005900036643","price_amount":44.47999999999999687361196265555918216705322265625},"1144-0":{"id":"1144","id_product":"1144","id_category_default":"170","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"DESODORANTE EN AEROSOL AXE BLACK CON 150 ML","category":"Desodorantes_y_antitranspirantes_para_hombre","category_name":"Desodorantes y antitranspirantes para hombre","reference":"7791293028781","supplier_reference":"","ean13":"7791293028781","price_amount":55.969999999999998863131622783839702606201171875},"3669-0":{"id":"3669","id_product":"3669","id_category_default":"175","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO AMMENS MANZANILLA CON 250 G","category":"Talcos","category_name":"Talcos","reference":"7502221182266","supplier_reference":"","ean13":"7502221182266","price_amount":45.46000000000000085265128291212022304534912109375},"2047-0":{"id":"2047","id_product":"2047","id_category_default":"168","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N DOVE EXFOLIACI\u00d3N SUAVE DE 135 G","category":"Jabon_de_tocador","category_name":"Jab\u00f3n de tocador","reference":"7501056371159","supplier_reference":"","ean13":"7501056371159","price_amount":28.589999999999999857891452847979962825775146484375},"1156-0":{"id":"1156","id_product":"1156","id_category_default":"171","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"DESODORANTE EN AEROSOL NIVEA DAMA CLASSIC TOUCH CON 150 ML","category":"Desodorantes_y_antitranspirantes_para_mujer","category_name":"Desodorantes y antitranspirantes para mujer","reference":"4005808829675","supplier_reference":"","ean13":"4005808829675","price_amount":59.7999999999999971578290569595992565155029296875},"1145-0":{"id":"1145","id_product":"1145","id_category_default":"170","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"DESODORANTE EN AEROSOL AXE BLACK CON 152 ML","category":"Desodorantes_y_antitranspirantes_para_hombre","category_name":"Desodorantes y antitranspirantes para hombre","reference":"7791293028774","supplier_reference":"","ean13":"7791293028774","price_amount":55.43999999999999772626324556767940521240234375},"3670-0":{"id":"3670","id_product":"3670","id_category_default":"175","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO AMMENS ORIGINAL CON 125 G","category":"Talcos","category_name":"Talcos","reference":"7502221182143","supplier_reference":"","ean13":"7502221182143","price_amount":30.219999999999998863131622783839702606201171875},"2335-0":{"id":"2335","id_product":"2335","id_category_default":"174","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"LOCI\u00d3N SIETE MACHOS CON 110 ML","category":"Fragancias","category_name":"Fragancias","reference":"7501168710211","supplier_reference":"","ean13":"7501168710211","price_amount":72.1099999999999994315658113919198513031005859375},"2048-0":{"id":"2048","id_product":"2048","id_category_default":"168","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N DOVE KARIT\u00c9 Y VAINILLA DE 135 G","category":"Jabon_de_tocador","category_name":"Jab\u00f3n de tocador","reference":"7506306230507","supplier_reference":"","ean13":"7506306230507","price_amount":26.530000000000001136868377216160297393798828125}};
// 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);
}
}