Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
Redirigir al usuario en la página al hacer clic en el enlace de los resultados de Google a alguna URL

Quiero hacer algo de lógica si el usuario hace clic en mi sitio web en los resultados de Google y va a mi sitio web, luego cuando hace clic en uno de los enlaces en el sitio web, se le redirige a alguna URL (por ejemplo, https://example.com )

Intenté de esta manera:

 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> var ref = document.referrer; document.write('document.referrer: ' + ref) $("a").click(function() { if (ref === "https://www.google.com/" || ref === "https://www.google.pl/") { window.location.href = "https://example.com"; } }); </script>

pero esta versión redirige al destino del enlace normal, no a example.com . ¿Cómo puedo mejorar esto?

Ahora esto funciona solo cuando mi enlace en el sitio web tiene target="_blank" , luego se redirige a example.com en la ventana principal y en la nueva ventana se redirige a la ubicación del enlace del sitio web.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!