Enhancing Healthcare with Virtual Tours: A Guide for Hospitals, Clinics, and Wellness Centers In...
// Delay Third-Party Scripts Until User Interaction
(function() {
var loaded = false;
function loadThirdPartyScripts() {
if (loaded) return;
loaded = true;
// reCAPTCHA will load when needed
// GTM and Facebook are already async
console.log('Third-party scripts allowed to load');
}
// Load on first user interaction
['scroll', 'mousemove', 'touchstart', 'click'].forEach(function(event) {
window.addEventListener(event, loadThirdPartyScripts, { once: true, passive: true });
});
// Or after 3 seconds
setTimeout(loadThirdPartyScripts, 3000);
})();