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 = {"270-0":{"id":"270","id_product":"270","id_category_default":"77","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ANDADERA DE ALUMINIO","category":"Rehabilitacion","category_name":"Rehabilitaci\u00f3n","reference":"7502276682865","supplier_reference":"","ean13":"7502276682865","price_amount":720.98000000000001818989403545856475830078125},"185-0":{"id":"185","id_product":"185","id_category_default":"79","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ALINEADOR NOCTURNO GRANDE DERECHO","category":"Cuidados_y_bienestar","category_name":"Cuidados y bienestar","reference":"0045468300187","supplier_reference":"","ean13":"0045468300187","price_amount":167.530000000000001136868377216160297393798828125},"787-0":{"id":"787","id_product":"787","id_category_default":"80","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"CINTA ADHESIVA KINESIOL\u00d3GICA COLOR PIEL DE 5 CM X 5 CM","category":"Deportes","category_name":"Deportes","reference":"7502276684524","supplier_reference":"","ean13":"7502276684524","price_amount":136.3600000000000136424205265939235687255859375},"186-0":{"id":"186","id_product":"186","id_category_default":"79","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ALINEADOR NOCTURNO GRANDE IZQUIERDO","category":"Cuidados_y_bienestar","category_name":"Cuidados y bienestar","reference":"0045468300132","supplier_reference":"","ean13":"0045468300132","price_amount":167.530000000000001136868377216160297393798828125},"848-0":{"id":"848","id_product":"848","id_category_default":"78","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"COLLAR FILADELFIA PEDI\u00c1TRICO GRANDE (8-12 A\u00d1OS)","category":"Infantil","category_name":"Infantil","reference":"7798083264107","supplier_reference":"","ean13":"7798083264107","price_amount":366.8799999999999954525264911353588104248046875},"272-0":{"id":"272","id_product":"272","id_category_default":"77","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ANDADERA ROLLATOR AJ-N1025 AZUL(EUP)","category":"Rehabilitacion","category_name":"Rehabilitaci\u00f3n","reference":"0000570003974","supplier_reference":"","ean13":"0000570003974","price_amount":1793.200000000000045474735088646411895751953125},"187-0":{"id":"187","id_product":"187","id_category_default":"79","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ALINEADOR NOCTURNO MEDIANO DERECHO","category":"Cuidados_y_bienestar","category_name":"Cuidados y bienestar","reference":"0045468300170","supplier_reference":"","ean13":"0045468300170","price_amount":167.530000000000001136868377216160297393798828125},"273-0":{"id":"273","id_product":"273","id_category_default":"77","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ANDADERA ROLLATOR COLOR NEGRO","category":"Rehabilitacion","category_name":"Rehabilitaci\u00f3n","reference":"9886761402571","supplier_reference":"","ean13":"9886761402571","price_amount":1915.299999999999954525264911353588104248046875},"188-0":{"id":"188","id_product":"188","id_category_default":"79","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ALINEADOR NOCTURNO MEDIANO IZQUIERDO","category":"Cuidados_y_bienestar","category_name":"Cuidados y bienestar","reference":"0045468300125","supplier_reference":"","ean13":"0045468300125","price_amount":167.530000000000001136868377216160297393798828125},"3470-0":{"id":"3470","id_product":"3470","id_category_default":"78","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"SILLA DE RUEDAS COLOR ROJO INFANTIL","category":"Infantil","category_name":"Infantil","reference":"98107771059475","supplier_reference":"","ean13":"0000000000000","price_amount":2596.09000000000014551915228366851806640625},"845-0":{"id":"845","id_product":"845","id_category_default":"76","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"COLLAR CERVICAL MEDIANO AZUL MARINO","category":"Ortesis_y_soportes","category_name":"Ortesis y soportes","reference":"7502276682728","supplier_reference":"","ean13":"7502276682728","price_amount":106.4899999999999948840923025272786617279052734375},"537-0":{"id":"537","id_product":"537","id_category_default":"79","id_manufacturer":"71","id_product_attribute":"0","cache_default_attribute":"0","name":"BOLSA PARA AGUA CALIENTE 1 PIEZA","manufacturer_name":"EDIGAR","category":"Cuidados_y_bienestar","category_name":"Cuidados y bienestar","reference":"7501463302005","supplier_reference":"","ean13":"0000000000000","price_amount":177.8700000000000045474735088646411895751953125},"274-0":{"id":"274","id_product":"274","id_category_default":"77","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ANDADERA ROLLATOR AJ-N1025 ROJA(EUP)","category":"Rehabilitacion","category_name":"Rehabilitaci\u00f3n","reference":"0000570003964","supplier_reference":"","ean13":"0000570003964","price_amount":1784.410000000000081854523159563541412353515625},"10801-0":{"id":"10801","id_product":"10801","id_category_default":"2","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"CABESTRILLO PEDIATRICO GRANDE PARA EDAD ENTRE 10 A 12 A\u00d1OS","category":"inicio","category_name":"Inicio","reference":"7502276680427","supplier_reference":"","ean13":"","price_amount":138.960000000000007958078640513122081756591796875},"846-0":{"id":"846","id_product":"846","id_category_default":"76","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"COLLAR CERVICAL UNIVERSAL MIAMI","category":"Ortesis_y_soportes","category_name":"Ortesis y soportes","reference":"7506123910309","supplier_reference":"","ean13":"7506123910309","price_amount":1753.470000000000027284841053187847137451171875},"538-0":{"id":"538","id_product":"538","id_category_default":"79","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"BOLSA PARA AGUA CALIENTE DE 1 LITRO","category":"Cuidados_y_bienestar","category_name":"Cuidados y bienestar","reference":"7502276685316","supplier_reference":"","ean13":"7502276685316","price_amount":89.590000000000003410605131648480892181396484375},"275-0":{"id":"275","id_product":"275","id_category_default":"77","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"ANDADERA ROLLATOR DE ALUMINIO COLOR VINO","category":"Rehabilitacion","category_name":"Rehabilitaci\u00f3n","reference":"7502276688612","supplier_reference":"","ean13":"7502276688612","price_amount":2055.170000000000072759576141834259033203125},"925-0":{"id":"925","id_product":"925","id_category_default":"80","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"CORREA UNIVERSAL PARA TOBILLO","category":"Deportes","category_name":"Deportes","reference":"7506123951906","supplier_reference":"","ean13":"7506123951906","price_amount":295.720000000000027284841053187847137451171875},"847-0":{"id":"847","id_product":"847","id_category_default":"76","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"COLLAR FILADELFIA PARA ADULTO TALLA CHICO","category":"Ortesis_y_soportes","category_name":"Ortesis y soportes","reference":"7798083264312","supplier_reference":"","ean13":"7798083264312","price_amount":377.029999999999972715158946812152862548828125},"539-0":{"id":"539","id_product":"539","id_category_default":"79","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"BOLSA PARA AGUA CALIENTE DE 1.5 LITROS","category":"Cuidados_y_bienestar","category_name":"Cuidados y bienestar","reference":"7502276685323","supplier_reference":"","ean13":"7502276685323","price_amount":102.590000000000003410605131648480892181396484375},"431-0":{"id":"431","id_product":"431","id_category_default":"77","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"BAST\u00d3N CON ASIENTO DAONSA","category":"Rehabilitacion","category_name":"Rehabilitaci\u00f3n","reference":"7501981804210","supplier_reference":"","ean13":"7501981804210","price_amount":357.81999999999999317878973670303821563720703125},"849-0":{"id":"849","id_product":"849","id_category_default":"76","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"COLLARIN CERVICAL AZUL MARINO CHICO","category":"Ortesis_y_soportes","category_name":"Ortesis y soportes","reference":"7502276682711","supplier_reference":"","ean13":"7502276682711","price_amount":106.4899999999999948840923025272786617279052734375},"432-0":{"id":"432","id_product":"432","id_category_default":"77","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"BAST\u00d3N DE 4 APOYOS DOBLE CUELLO BASE PEQUE\u00d1A EN COLORES","category":"Rehabilitacion","category_name":"Rehabilitaci\u00f3n","reference":"7502276683664","supplier_reference":"","ean13":"7502276683664","price_amount":331.17000000000001591615728102624416351318359375},"850-0":{"id":"850","id_product":"850","id_category_default":"76","id_manufacturer":"0","id_product_attribute":"0","cache_default_attribute":"0","name":"COLLARIN CERVICAL AZUL MARINO GRANDE","category":"Ortesis_y_soportes","category_name":"Ortesis y soportes","reference":"7502276682735","supplier_reference":"","ean13":"7502276682735","price_amount":106.4899999999999948840923025272786617279052734375}};
// 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);
}
}