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 = {"3664-0":{"id":"3664","id_product":"3664","id_category_default":"236","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO AMMENS BABY CON 125 G","category":"Talcos_para_bebe","category_name":"Talcos para beb\u00e9","reference":"7502221182181","supplier_reference":"","ean13":"7502221182181","price_amount":28.64999999999999857891452847979962825775146484375},"2060-0":{"id":"2060","id_product":"2060","id_category_default":"235","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N HUGGIES CUIDADO RELAJANTE CON 80 G","category":"Shampoo_y_jabones","category_name":"Shampoo y jabones","reference":"7501943450103","supplier_reference":"","ean13":"7501943450103","price_amount":14.6699999999999999289457264239899814128875732421875},"19-0":{"id":"19","id_product":"19","id_category_default":"231","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ACEITE PARA BEB\u00c9 JALOMA DE 120 ML","category":"Aceite","category_name":"Aceite","reference":"0759684154157","supplier_reference":"","ean13":"0759684154157","price_amount":18.3599999999999994315658113919198513031005859375},"3665-0":{"id":"3665","id_product":"3665","id_category_default":"236","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO AMMENS BABY CON 250 G","category":"Talcos_para_bebe","category_name":"Talcos para beb\u00e9","reference":"7502221182174","supplier_reference":"","ean13":"7502221182174","price_amount":40.27000000000000312638803734444081783294677734375},"20-0":{"id":"20","id_product":"20","id_category_default":"231","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ACEITE PARA BEB\u00c9 JOHNSON'S DE 200 ML","category":"Aceite","category_name":"Aceite","reference":"7891010031053","supplier_reference":"","ean13":"7891010031053","price_amount":57.030000000000001136868377216160297393798828125},"3674-0":{"id":"3674","id_product":"3674","id_category_default":"236","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO JOHNSON'S BABY CON 100 G","category":"Talcos_para_bebe","category_name":"Talcos para beb\u00e9","reference":"7891010037246","supplier_reference":"","ean13":"7891010037246","price_amount":31.6400000000000005684341886080801486968994140625},"2063-0":{"id":"2063","id_product":"2063","id_category_default":"235","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N JOHNSON'S BABY ANTES DE DORMIR CON 75 G","category":"Shampoo_y_jabones","category_name":"Shampoo y jabones","reference":"7501007502441","supplier_reference":"","ean13":"7501007502441","price_amount":14},"21-0":{"id":"21","id_product":"21","id_category_default":"231","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ACEITE PARA BEB\u00c9 MENEN DE 100 ML","category":"Aceite","category_name":"Aceite","reference":"7501035908246","supplier_reference":"","ean13":"7501035908246","price_amount":33.5799999999999982946974341757595539093017578125},"2064-0":{"id":"2064","id_product":"2064","id_category_default":"235","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N JOHNSON'S BABY NEUTRO CON 80 G","category":"Shampoo_y_jabones","category_name":"Shampoo y jabones","reference":"7501007501031","supplier_reference":"","ean13":"7501007501031","price_amount":14},"22-0":{"id":"22","id_product":"22","id_category_default":"231","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ACEITE PARA BEB\u00c9 MENEN DE 200 ML","category":"Aceite","category_name":"Aceite","reference":"7501035908253","supplier_reference":"","ean13":"7501035908253","price_amount":48.75999999999999801048033987171947956085205078125},"3678-0":{"id":"3678","id_product":"3678","id_category_default":"236","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO MENEN BABY AZUL CON 100 G","category":"Talcos_para_bebe","category_name":"Talcos para beb\u00e9","reference":"7501035908116","supplier_reference":"","ean13":"7501035908116","price_amount":38.7000000000000028421709430404007434844970703125},"2086-0":{"id":"2086","id_product":"2086","id_category_default":"235","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N RICITOS DE ORO AVENA COLOIDAL CON 90 G","category":"Shampoo_y_jabones","category_name":"Shampoo y jabones","reference":"7501022150214","supplier_reference":"","ean13":"7501022150214","price_amount":18.660000000000000142108547152020037174224853515625},"23-0":{"id":"23","id_product":"23","id_category_default":"231","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ACEITE PARA BEB\u00c9 MENEN DE 50 ML","category":"Aceite","category_name":"Aceite","reference":"7501035908239","supplier_reference":"","ean13":"7501035908239","price_amount":23.660000000000000142108547152020037174224853515625},"3679-0":{"id":"3679","id_product":"3679","id_category_default":"236","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO MENEN BABY AZUL CON 200 G","category":"Talcos_para_bebe","category_name":"Talcos para beb\u00e9","reference":"7501035908130","supplier_reference":"","ean13":"7501035908130","price_amount":59.409999999999996589394868351519107818603515625},"2087-0":{"id":"2087","id_product":"2087","id_category_default":"235","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N RICITOS DE ORO LAVANDA Y LECHUGA CON 90 G","category":"Shampoo_y_jabones","category_name":"Shampoo y jabones","reference":"7501022105344","supplier_reference":"","ean13":"7501022105344","price_amount":13.9199999999999999289457264239899814128875732421875},"853-0":{"id":"853","id_product":"853","id_category_default":"215","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"COLONIA PARA BEB\u00c9 MENEN CON 200 ML","category":"Cuidados_del_bebe","category_name":"Cuidados del beb\u00e9","reference":"7501035911796","supplier_reference":"","ean13":"7501035911796","price_amount":64.06999999999999317878973670303821563720703125},"3680-0":{"id":"3680","id_product":"3680","id_category_default":"236","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO MENEN BABY ROSA CON 100 G","category":"Talcos_para_bebe","category_name":"Talcos para beb\u00e9","reference":"7501035908123","supplier_reference":"","ean13":"7501035908123","price_amount":32.00999999999999801048033987171947956085205078125},"1019-0":{"id":"1019","id_product":"1019","id_category_default":"215","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"CREMA RICITOS DE ORO MANZANILLA DE 100 ML","category":"Cuidados_del_bebe","category_name":"Cuidados del beb\u00e9","reference":"7501022104248","supplier_reference":"","ean13":"7501022104248","price_amount":24.71000000000000085265128291212022304534912109375},"3681-0":{"id":"3681","id_product":"3681","id_category_default":"236","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"TALCO MENEN BABY ROSA CON 200 G","category":"Talcos_para_bebe","category_name":"Talcos para beb\u00e9","reference":"7501035908147","supplier_reference":"","ean13":"7501035908147","price_amount":60.77000000000000312638803734444081783294677734375},"2089-0":{"id":"2089","id_product":"2089","id_category_default":"235","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N RICITOS DE ORO MIEL CON 90 G","category":"Shampoo_y_jabones","category_name":"Shampoo y jabones","reference":"7501022150412","supplier_reference":"","ean13":"7501022150412","price_amount":20.3299999999999982946974341757595539093017578125},"2090-0":{"id":"2090","id_product":"2090","id_category_default":"235","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N RICITOS DE ORO NEUTRO CON 90 G","category":"Shampoo_y_jabones","category_name":"Shampoo y jabones","reference":"7501022150221","supplier_reference":"","ean13":"7501022150221","price_amount":18.660000000000000142108547152020037174224853515625},"4053-0":{"id":"4053","id_product":"4053","id_category_default":"215","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"VASELINE BEB\u00c9 DE 215 G","category":"Cuidados_del_bebe","category_name":"Cuidados del beb\u00e9","reference":"7501056339562","supplier_reference":"","ean13":"7501056339562","price_amount":96.25},"4131-0":{"id":"4131","id_product":"4131","id_category_default":"215","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"VICK BABYBALM TARRO DE 50 G","category":"Cuidados_del_bebe","category_name":"Cuidados del beb\u00e9","reference":"7501001168797","supplier_reference":"","ean13":"7501001168797","price_amount":96.1700000000000017053025658242404460906982421875},"2061-0":{"id":"2061","id_product":"2061","id_category_default":"235","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"JAB\u00d3N HUGGIES RECIEN NACIDO CON 75 G","category":"Shampoo_y_jabones","category_name":"Shampoo y jabones","reference":"7501943472693","supplier_reference":"","ean13":"7501943472693","price_amount":12.9900000000000002131628207280300557613372802734375}};
// 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);
}
}