Strategy
Desarrollo sostenible 4.7 (3)
Discover what sustainable development is and how to apply it in your company. Find out the keys to contribute to the care of the environment and how you can
LEER MÁS
Planificación estratégica 0 (0)
In this article we explain what strategic planning is and why it is important for your company. Discover its stages
LEER MÁS
Experiencia acumulada como ventaja competitiva 5 (1)
Discover how accumulated experience can become a competitive advantage in your business. Tips and strategies in the article
LEER MÁS
Barreras de salida de un cliente 0 (0)
Learn about customer exit barriers and how they can affect your business. Find out how to overcome them and improve the customer experience.
LEER MÁS
Rivalidad entre competidores 4 (4)
Explore the rivalry between competitors and how to deal with it strategically. Discover keys to stand out in the marketplace
LEER MÁS
Busca imperfecciones en el mercado. Mercado perfecto 5 (1)
Find out how looking for imperfections in the market can help you find business opportunities. Tips and strategies in the article
LEER MÁS
Análisis DAFO de tu empresa 4 (2)
Conduct a SWOT analysis of your company to identify strengths, weaknesses, opportunities and threats. Learn how to do it
LEER MÁS
Discover effective business diversification strategies to expand your business and reduce risk. Get insights in this article
LEER MÁS
Estrategias de seguidor o remolque 0 (0)
Learn about follower or trailer strategies and how they can benefit your business. Find out more in our article
LEER MÁS
Plan de implantación. Diagrama de Gantt o Diagrama de barras 4.3 (3)
Accelerate your business with these expert tips on "Implementation Plan. Gantt Chart or Bar Chart". Analyse and discover this TIP!
LEER MÁS

  • mentorVIRTUAL: Soy tu mentorVIRTUAL. ¿alguna pregunta?

La respuesta tardará unos 20 segundos. Generando respuesta ...

ISSUES

Ir al contenido function ZFAdvLead(){ } ZFAdvLead.utmPValObj = ZFAdvLead.utmPValObj || {}; ZFAdvLead.utmPNameArr = new Array('utm_source','utm_medium','utm_campaign','utm_term','utm_content');ZFAdvLead.utmcustPNameArr = new Array();ZFAdvLead.isSameDomian = false; ZFAdvLead.prototype.zfautm_sC = function( paramName,path,domain,secure ){ var value = ZFAdvLead.utmPValObj[paramName]; if ( typeof value !== "undefined" && value !== null ){ var cookieStr = paramName + "=" + encodeURIComponent( value ); var exdate=new Date(); exdate.setDate(exdate.getDate()+7); cookieStr += "; expires=" + exdate.toGMTString(); cookieStr += "; path=/"; if ( domain ) { cookieStr += "; domain=" + encodeURIComponent( domain ); } if ( secure ) { cookieStr += "; secure"; } document.cookie = cookieStr; } }; ZFAdvLead.prototype.zfautm_ini = function (){ this.zfautm_bscPCap(); var url_search = document.location.search; for (var i = 0; i < ZFAdvLead.utmcustPNameArr.length ; i ++){ var zf_pN = ZFAdvLead.utmcustPNameArr[i]; var zf_pV; if ( zf_pN == 'referrername' ) { zf_pV = ( document.URL || '' ).slice( 0, 1500 ); } else { zf_pV = this.zfautm_gP(url_search, zf_pN); if (zf_pV == undefined || zf_pV == ''){ zf_pV = this.zfautm_gC(zf_pN); } } if ( typeof zf_pV !== "undefined" && zf_pV !== null & zf_pV != "" ) { ZFAdvLead.utmPValObj[ zf_pN ] = zf_pV; } } for (var pkey in ZFAdvLead.utmPValObj) { this.zfautm_sC(pkey); } }; ZFAdvLead.prototype.zfautm_bscPCap = function () { var trafSrc = this.zfautm_calcTrafSrc(); if ( trafSrc.source != "" ) { ZFAdvLead.utmPValObj.utm_source = trafSrc.source; } if ( trafSrc.medium != "" ) { ZFAdvLead.utmPValObj.utm_medium = trafSrc.medium; } if ( trafSrc.campaign != "" ) { ZFAdvLead.utmPValObj.utm_campaign = trafSrc.campaign; } if ( trafSrc.term != "" ) { ZFAdvLead.utmPValObj.utm_term = trafSrc.term; } if ( trafSrc.content != "" ) { ZFAdvLead.utmPValObj.utm_content = trafSrc.content; } } ZFAdvLead.prototype.zfautm_calcTrafSrc = function() { var u1='', u2='', u3='', u4='', u5=''; var search_engines = [['bing', 'q'], ['google', 'q'], ['yahoo', 'q'], ['baidu', 'q'], ['yandex', 'q'], ['ask', 'q']]; //List of search engines var ref = document.referrer; ref = ref.substr(ref.indexOf('//')+2); ref_domain = ref; ref_path = '/'; ref_search = ''; // Checks for campaign parameters var url_search = document.location.search; if(url_search.indexOf('utm_source') > -1 || url_search.indexOf('utm_medium') > -1 || url_search.indexOf('utm_campaign') > -1 || url_search.indexOf('utm_term') > -1 || url_search.indexOf('utm_content') > -1) { u1 = this.zfautm_gP(url_search, 'utm_source'); u2 = this.zfautm_gP(url_search, 'utm_medium'); u3 = this.zfautm_gP(url_search, 'utm_campaign'); u4 = this.zfautm_gP(url_search, 'utm_term'); u5 = this.zfautm_gP(url_search, 'utm_content'); } else if ( this.zfautm_gP(url_search, 'gclid')) { u1 = 'Google Ads'; u2 = 'cpc'; u3 = '(not set)'; if ( !ZFAdvLead.utmcustPNameArr.includes('gclid') ) { ZFAdvLead.utmcustPNameArr.push('gclid'); } } else if(ref) { var r_u1 = this.zfautm_gC('utm_source'); var r_u2 = this.zfautm_gC('utm_medium'); var r_u3 = this.zfautm_gC('utm_campaign'); var r_u4 = this.zfautm_gC('utm_term'); var r_u5 = this.zfautm_gC('utm_content'); if ( typeof r_u1 === "undefined" && typeof r_u2 === "undefined" && typeof r_u3 === "undefined" && typeof r_u4 === "undefined" && typeof r_u5 === "undefined") { // separate domain, path and query parameters if (ref.indexOf('/') > -1) { ref_domain = ref.substr(0,ref.indexOf('/')); ref_path = ref.substr(ref.indexOf('/')); if (ref_path.indexOf('?') > -1) { ref_search = ref_path.substr(ref_path.indexOf('?')); ref_path = ref_path.substr(0, ref_path.indexOf('?')); } } u2 = 'referral'; u1 = ref_domain; // Extract term for organic source for (var i=0; i -1){ u2 = 'organic'; u1 = search_engines[i][0]; u4 = this.zfautm_gP(ref_search, search_engines[i][1]) || '(not provided)'; break; } } } else { if ( typeof r_u1 !== "undefined" ) { u1 = r_u1; } if ( typeof r_u2 !== "undefined" ) { u2 = r_u2; } if ( typeof r_u3 !== "undefined" ) { u3 = r_u3; } if ( typeof r_u4 !== "undefined" ) { u4 = r_u4; } if ( typeof r_u5 !== "undefined" ) { u5 = r_u5; } } } else { var r_u1 = this.zfautm_gC('utm_source'); var r_u2 = this.zfautm_gC('utm_medium'); var r_u3 = this.zfautm_gC('utm_campaign'); var r_u4 = this.zfautm_gC('utm_term'); var r_u5 = this.zfautm_gC('utm_content'); if ( typeof r_u1 === "undefined" && typeof r_u2 === "undefined" && typeof r_u3 === "undefined" && typeof r_u4 === "undefined" && typeof r_u5 === "undefined") { var locRef = document.URL; locRef = locRef.substr(locRef.indexOf('//')+2); if (locRef.indexOf('/') > -1) { locRef = locRef.substr(0,locRef.indexOf('/')); } u1 = locRef; u2 = 'referral'; } else { if ( typeof r_u1 !== "undefined" ) { u1 = r_u1; } if ( typeof r_u2 !== "undefined" ) { u2 = r_u2; } if ( typeof r_u3 !== "undefined" ) { u3 = r_u3; } if ( typeof r_u4 !== "undefined" ) { u4 = r_u4; } if ( typeof r_u5 !== "undefined" ) { u5 = r_u5; } } } return { 'source' : u1, 'medium' : u2, 'campaign': u3, 'term' : u4, 'content' : u5 }; } ZFAdvLead.prototype.zfautm_gP = function(s, q) { try{ var match = s.match('[?&]' + q + '=([^&]+)'); return match ? decodeURIComponent(match[1]) : ''; } catch(e){ return ''; } } ZFAdvLead.prototype.zfautm_gC = function( cookieName ){ var cookieArr = document.cookie.split('; '); for ( var i = 0 ; i < cookieArr.length ; i ++ ){ var cookieVals = cookieArr[i].split('='); if ( cookieVals[0] === cookieName && cookieVals[1] ) { return decodeURIComponent(cookieVals[1]); } } }; ZFAdvLead.prototype.zfautm_gC_enc = function( cookieName ){ var cookieArr = document.cookie.split('; '); for ( var i = 0 ; i < cookieArr.length ; i ++ ){ var cookieVals = cookieArr[i].split('='); if ( cookieVals[0] === cookieName && cookieVals[1] ) { return cookieVals[1]; } } }; ZFAdvLead.prototype.zfautm_iframeSprt = function () { var zf_frame = document.getElementsByTagName("iframe"); for(var i = 0; i < zf_frame.length; ++i){ if((zf_frame[i].src).indexOf('formperma') > 0 ){ var zf_src = zf_frame[i].src; for( var prmIdx = 0 ; prmIdx < ZFAdvLead.utmPNameArr.length ; prmIdx ++ ) { var utmPm = ZFAdvLead.utmPNameArr[ prmIdx ]; utmPm = ( ZFAdvLead.isSameDomian && ( ZFAdvLead.utmcustPNameArr.indexOf(utmPm) == -1 ) ) ? "zf_" + utmPm : utmPm; var utmVal = this.zfautm_gC_enc( ZFAdvLead.utmPNameArr[ prmIdx ] ); if ( typeof utmVal !== "undefined" ) { if ( utmVal != "" ){ if(zf_src.indexOf('?') > 0){ zf_src = zf_src+'&'+utmPm+'='+ utmVal; }else{ zf_src = zf_src+'?'+utmPm+'='+ utmVal; } } } } if ( zf_frame[i].src.length < zf_src.length ) { zf_frame[i].src = zf_src; } } } }; ZFAdvLead.prototype.zfautm_DHtmlSprt = function () { var zf_formsArr = document.forms; for ( var frmInd = 0 ; frmInd < zf_formsArr.length ; frmInd ++ ) { var zf_form_act = zf_formsArr[frmInd].action; if ( zf_form_act && zf_form_act.indexOf('formperma') > 0 ){ for( var prmIdx = 0 ; prmIdx < ZFAdvLead.utmPNameArr.length ; prmIdx ++ ) { var utmPm = ZFAdvLead.utmPNameArr[ prmIdx ]; var utmVal = this.zfautm_gC( ZFAdvLead.utmPNameArr[ prmIdx ] ); if ( typeof utmVal !== "undefined" ) { if ( utmVal != "" ) { var fieldObj = zf_formsArr[frmInd][utmPm]; if ( fieldObj ) { fieldObj.value = utmVal; } } } } } } }; ZFAdvLead.prototype.zfautm_jsEmbedSprt = function ( id ) { document.getElementById('zforms_iframe_id').removeAttribute("onload"); var jsEmbdFrm = document.getElementById("zforms_iframe_id"); var embdSrc = jsEmbdFrm.src; for( var prmIdx = 0 ; prmIdx < ZFAdvLead.utmPNameArr.length ; prmIdx ++ ) { var utmPm = ZFAdvLead.utmPNameArr[ prmIdx ]; utmPm = ( ZFAdvLead.isSameDomian && ( ZFAdvLead.utmcustPNameArr.indexOf(utmPm) == -1 ) ) ? "zf_" + utmPm : utmPm; var utmVal = this.zfautm_gC_enc( ZFAdvLead.utmPNameArr[ prmIdx ] ); if ( typeof utmVal !== "undefined" ) { if ( utmVal != "" ) { if(embdSrc.indexOf('?') > 0){ embdSrc = embdSrc+'&'+utmPm+'='+utmVal; }else{ embdSrc = embdSrc+'?'+utmPm+'='+utmVal; } } } } jsEmbdFrm.src = embdSrc; }; var zfutm_zfAdvLead = new ZFAdvLead(); zfutm_zfAdvLead.zfautm_ini(); if( document.readyState == "complete" ){ zfutm_zfAdvLead.zfautm_iframeSprt(); zfutm_zfAdvLead.zfautm_DHtmlSprt(); } else { window.addEventListener('load', function (){ zfutm_zfAdvLead.zfautm_iframeSprt(); zfutm_zfAdvLead.zfautm_DHtmlSprt(); }, false); } Si estás usando la biblioteca jQuery, entonces no olvides envolver tu código dentro de jQuery.ready() así: jQuery(document).ready(function( $ ){ // Tu código aquí dentro }); -- Si quieres enlazar a un archivo JavaScript que resida en otro servidor (como ), entonces, por favor, usa la página «Añadir código HTML» , ya que es un código HTML que enlaza a un archivo JavaScript. Fin del comentario */