Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » Joomla »

Chronoforms y track de referidos

Estas en el tema de Chronoforms y track de referidos en el foro de Joomla en Foros del Web. Hola, tengo instalado CHRONOFORMS en Joomla. Todo fantástico: es un excelente componente. El tema es que tengo que ejecutar el siguiente javascript en un formulario ...
  #1 (permalink)  
Antiguo 22/08/2010, 23:22
 
Fecha de Ingreso: septiembre-2009
Mensajes: 87
Antigüedad: 14 años, 7 meses
Puntos: 1
Chronoforms y track de referidos

Hola, tengo instalado CHRONOFORMS en Joomla. Todo fantástico: es un excelente componente. El tema es que tengo que ejecutar el siguiente javascript en un formulario para determinar la landing page del usuario una vez que llega a pedir información sobre un producto o servicio.

Código Javascript:
Ver original
  1. <script type="text/javascript"><!--
  2. // Obtained from http://www.willmaster.com/
  3. //
  4. // Specify maximum number of history links to keep,
  5. //    minimum 1.
  6. var MaximumNumberOfLinks = 15;
  7.  
  8. // Specify cookie name.
  9. var CookieName = "HistoryLinks";
  10.  
  11. // Specify number of days cookie is to remain on visitor's
  12. //    computer. (Use 0 to delete cookie when browser closed.)
  13. var DaysToLive = 366;
  14.  
  15. // No other customizations required.
  16. var HistoryLink = new Array();
  17. var HistoryTitle = new Array();
  18. var CurrentPage = new String();
  19. var HistoryContent = new String();
  20. DaysToLive = parseInt(DaysToLive);
  21. MaximumNumberOfLinks = parseInt(MaximumNumberOfLinks);
  22. if( MaximumNumberOfLinks < 1 ) { MaximumNumberOfLinks = 10; }
  23.  
  24. function GetCookie() {
  25. var cookiecontent = '';
  26. if(document.cookie.length > 0) {
  27.    var cookiename = CookieName + '=';
  28.    var cookiebegin = document.cookie.indexOf(cookiename);
  29.    if(cookiebegin > -1) {
  30.       cookiebegin += cookiename.length;
  31.       var cookieend = document.cookie.indexOf(";",cookiebegin);
  32.       if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
  33.       cookiecontent = document.cookie.substr(cookiebegin,cookieend);
  34.       }
  35.    }
  36. if( cookiecontent.length < 3 ) { return; }
  37. cookiecontent = unescape(cookiecontent);
  38. var historyList = cookiecontent.split('&');
  39. for( var i = 0; i < historyList.length; i++ ) {
  40.    var link = historyList[i].split('=',2);
  41.    HistoryLink.push(link[0]);
  42.    HistoryTitle.push(link[1]);
  43.    var temparray = link[0].split('~amp;');
  44.    link[0] = temparray.join('&');
  45.    temparray = link[1].split('~amp;');
  46.    link[1] = temparray.join('&');
  47.    HistoryContent += '<'+'p>'+'<'+'a href="'+link[0]+'">'+link[1]+'<'+'/'+'a>'+'<'+'/'+'p>';
  48.    }
  49. }
  50.  
  51. function PutCookie() {
  52. if( HistoryLink.length < 1 ) { return; }
  53. var len = HistoryLink.length;
  54. while( HistoryLink.length > MaximumNumberOfLinks ) {
  55.    HistoryTitle.shift();
  56.    HistoryLink.shift();
  57.    }
  58. var pairs = new Array();
  59. for( var i = 0; i < HistoryLink.length; i++ ) { pairs.push(HistoryLink[i]+'='+HistoryTitle[i]); }
  60. var value = pairs.join('&');
  61. var exp = new String();
  62. if(DaysToLive > 0) {
  63.    var now = new Date();
  64.    now.setTime( now.getTime() + (DaysToLive * 24 * 60 * 60 * 1000) );
  65.    exp = '; expires=' + now.toGMTString();
  66.    }
  67. document.cookie = CookieName + "=" + escape(value) + '; path=/' + exp;
  68. }
  69.  
  70. function RecordCurrentPage() {
  71. var link = document.URL;
  72. var title = document.title.length > 1 ? document.title : 'Untitled';
  73. CurrentPage = '<'+'p>'+title+'<'+'/'+'p>';
  74. var temparray = link.split('&');
  75. link = temparray.join('~amp;');
  76. var temparray = title.split('&');
  77. title = temparray.join('~amp;');
  78. HistoryLink.push(link);
  79. HistoryTitle.push(title);
  80. }
  81.  
  82. GetCookie();
  83. RecordCurrentPage();
  84. PutCookie();
  85. //--></script>

Y correr el siguiente script para que escriba los valores almacenados en la cookie:
Código Javascript:
Ver original
  1. <script type="text/javascript"><!--
  2. if(HistoryContent.length) {
  3.  
  4. document.write('<'+'div ');
  5. document.write(' id="visitorhistory" ');
  6. document.write(' style="border-style:solid; border-width:1px; padding:0 5px 10px 20px;">');
  7.  
  8. document.write('<'+'h3>El visitante estuvo en:<'+'/h3>');
  9.  
  10. document.write(HistoryContent);
  11.  
  12. document.write('<'+'h3>El visitante estuvo en:<'+'/h3>');
  13.  
  14. document.write(CurrentPage);
  15.  
  16. document.write('<'+'/div>');
  17.  
  18. }
  19. //--></script>

Desconozco como escribir el segundo snippet en un campo hidden en vez de ejecutarlo y mostrarlo al usuario usando chronoforms.

Alguien tiene idea?

Etiquetas: referidos, track
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:34.