Acerca de nuestros términos y condiciones >

Inaugurado en el 2006 por las mismas mentes maestras detrás de Cicciolina (otro de los restaurantes favoritos del Cusco), Baco es la experiencia gastronómica casual que la gente anhela luego de un día visitando ruinas, museos y aventuras en el Valle Sagrado. Es un restaurante donde el nivel y la calidad de atención a los...
Read More
/** * Hendryxx1 * * el localstorage va a guarda run objeto con los utms extra (datos de rastreo y otros) * Campos nuevos: * utm_source__c * Web__c * Programa__c * Programa_de_inter_s__c * Where_did_you_hear_about_us__c * * extracmposhendryxx1: * subject__c * mensaje__c */ //variables const $formsListWcf7 = document.querySelectorAll('form.wpcf7-form'); /** * setUTMs */ function setUTMs(){ let utmStorageItem = { utmSource: '', utmCampaign: '', utmMedium: '', ip: getIp(), }; const queryString = location.href.split('?')[1]; if (queryString) { var query = queryString.replace("&", "&").replace("&", "&").split("&"); query.forEach((item) => { var querylist = item.split("="); switch (querylist[0].toUpperCase()) { case 'UTM_SOURCE': utmStorageItem.utmSource = querylist[1]; break; case 'UTM_MEDIUM': utmStorageItem.utmMedium = querylist[1]; break; case 'UTM_CAMPAIGN': utmStorageItem.utmCampaign = querylist[1]; break; } }); } localStorage.setItem('utm_storage_item', JSON.stringify(utmStorageItem) ) return utmStorageItem; } /** * getIp */ function getIp(){ if(localStorage.getItem('NAVIGATOR_IP')){ return localStorage.getItem('NAVIGATOR_IP'); }else return "0.0.0.0"; } /** * webToLead * @param {fields} fields */ function webToLead(fields) { console.log(fields); fields['retURL']='https://www.explorandes.com/es/gracias/';//dummy URL var form = document.createElement("form"); form.method = "POST"; form.action = "https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8"; //form.setAttribute("target", customHiddenIframeName); for (var fieldName in fields) { var theInput = document.createElement("input"); theInput.name=fieldName; theInput.value=fields[fieldName]; theInput.setAttribute("type", "hidden"); form.appendChild(theInput); } document.body.appendChild(form); cleanUTMs(); form.submit(); } /** * getUTMs */ function getUTMs(){ let utmStorageItem = JSON.parse(localStorage.getItem('utm_storage_item')); if( utmStorageItem ) return utmStorageItem; else{ return setUTMs(); } } /** * existNewUTMs() * returna true si existen nuevos utms */ function existNewUTMs(){ const queryString = location.href.split('?')[1]; return queryString != undefined } /** * clean utms */ function cleanUTMs(){ localStorage.removeItem('utm_storage_item'); } /** * main */ function mainFormData(){ if(existNewUTMs()){ setUTMs(); } } /** * Event Listeners */ $formsListWcf7.forEach($form => { $form.addEventListener('submit', (ev)=>{ ev.preventDefault() console.log(5544) let form = new FormData($form); let utms = getUTMs(); let payload = { //"00N5w00000RLaei": '', //Nacionalidad //"00N5w00000RLaf7": "", //Donde escuchaste hablar de nosotros //"00N5w00000RM08K": "", //Donde escuchaste hablar de nosotros //"00N5w00000RM08Z": "", //What kind of experience are you looking //"00N5w00000RLypH": "", //Pais // hidden: "00N5w00000RLaex": utms.utmSource, //Source "00N5w00000RNMJH": utms.utmCampaign, //utm_campaign "00N5w00000RNMMk": utms.utmMedium, //utm_medium, "00N5w00000RNMMp": utms.utmSource, //utm_source, "00N5w00000RNMMu": utms.ip, //ip, //salesforce_data oid: '00D5w000007L2Oz', } if( form.get('cf_asunto')){ //Campos para payload['first_name'] = form.get('nombre'); payload['last_name'] = form.get('last_name'); payload['email'] = form.get('your-email'); payload['phone'] = form.get('phonetext-42escontacto'); payload['00N5w00000RLaei'] = form.get('countrytext-415escontacto');//nacionalidad payload['00N5w00000RNMN9'] = form.get('cf_asunto'); //asunto payload['00N5w00000RNMNE'] = form.get('cf_mensaje'); //mensaje payload['00N5w00000RM08Z'] = form.get('cf_selected_tour'); //Donde escuchaste hablar de nosotros payload['00N5w00000RLaf7'] = form.get('cf_selected_tour'); //Donde escuchaste hablar de nosotros }else{ const nameElem = document.querySelector('h1.tourmaster-single-header-title'); let tripName = "undefined"; if(nameElem){ tripName = nameElem.innerHTML; } // countrytext-415es payload['first_name'] = form.get('Nombre'); payload['last_name'] = form.get('lastname'); payload['email'] = form.get('email'); payload['phone'] = form.get('phonetext-42es'); payload['00N5w00000RLaei'] = form.get('countrytext-415es');//nacionalidad payload['00N5w00000RNMRf'] = form.get('viajeros')//Numero de viajeros //00N5w00000RMAYw payload['00N5w00000RM08U'] = form.get('viajeros')//numero de viajeros payload['00N5w00000RLafC'] = tripName//programa payload['00N5w00000RM08Z'] = form.get('Mensaje') //que typo de experiencia estas busacando payload['00N5w00000RLaf7'] = form.get('cf_selected_tour'); //Donde escuchaste hablar de nosotros //programa de interes 00N5w00000RLafC } webToLead(payload) }) }); document.addEventListener('DOMContentLoaded', (ev)=>{ mainFormData(); });