Articles & Alerts
All Articles & Alerts
Nothing found.
document.addEventListener("DOMContentLoaded", function () { const interval = setInterval(() => { // Find the Elfsight button const elfsightButton = document.querySelector('.elfsight-app-917ad6f3-78b1-4827-b99f-c87d92d48b39 a'); if (elfsightButton) { // Capture the current page path dynamically const currentPagePath = encodeURIComponent(window.location.pathname); // E.g., "/industries/architecture-and-engineering/" // Replace utm_source in the URL const originalUrl = elfsightButton.href; // Original Elfsight URL const updatedUrl = originalUrl.replace( /utm_source=[^&]+/, // Regex to find existing utm_source `utm_source=${currentPagePath}` // Replace with dynamic path ); // Update the button link elfsightButton.href = updatedUrl; // Stop the interval once updated clearInterval(interval); } }, 100); // Check every 100ms });