• 1
  • 2
(function () { // Get the URL parameters from the current URL const currentUrl = window.location.href; const viaParam = currentUrl.split('?')[1]; // Extract everything after the "?" // If the viaParam exists, append it to all relevant links if (viaParam) { // Select all anchor links on the page const links = document.querySelectorAll('a'); links.forEach(link => { const href = link.getAttribute('href'); // Only modify links with relative paths or specific conditions if (href && href.startsWith("https://portal.avatalk.me/")) { // Check if the link already has a "?" const separator = href.includes('?') ? '&' : '?'; link.setAttribute('href', href + separator + viaParam); } }); } })(); document.addEventListener('DOMContentLoaded', function () { const urlParams = new URLSearchParams(window.location.search); const viaParam = urlParams.get('via'); if (viaParam) { const ctaButton = document.querySelector('a[href="https://portal.avatalk.me/#/signup"]'); if (ctaButton) { ctaButton.href = `https://portal.avatalk.me/#/signup?via=${viaParam}`; } } });