Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

120
Vistas
Add parameters URL using javascript

I have a landing page with several products, with their own url per product. I want to transfer the tracking from the landing URL to the products URL, so I'm using this script:

    <script>
      var params = $.param(getUrlVars());
      $("a").attr('href', function(i, h) {
         return h + (h.indexOf('?') != -1 ? "&" + params : "?" + params);
      });
    </script>

It's working as expected, so from the URL

https://test.landing.com/?affiliate=XXX&utm_source=landing&utm_medium=test&utm_campaign=landing-test&utm_content=afiliate-test

I get the product URL

https://test.landing.com/product-test/?&utm_source=landing&utm_medium=test&utm_campaign=landing-test&utm_content=afiliate-test

I want to add to the parameter "affiliate=XXX"

Can please someone tell me how can I do it?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda