Home » Technology » The Italian ‘land of eternal youth’ where 1 in 10 residents live beyond 100 — here’s their secret to longevity |

The Italian ‘land of eternal youth’ where 1 in 10 residents live beyond 100 — here’s their secret to longevity |

“`html

function loadFBEvents(isFBCampaignActive) {
if (isFBCampaignActive) {
console.log("Loading Facebook Pixel events...");
// Placeholder for Facebook Pixel event loading logic
}
}

function loadSurvicateJs(allowedSurvicateSections) {
if (allowedSurvicateSections) {
(function(w) {
var prime_user_status = window.isPrime || false;
var geoLocation = window.geoLocation || "unknown";

if (w._sva && w._sva.setVisitorTraits) {
w._sva.setVisitorTraits({
toi_user_subscription_status: prime_user_status,
toi_user_geolocation: geoLocation,
toi_allowed_survicate_sections: allowedSurvicateSections
});
} else {
w.addEventListener("SurvicateReady", function() {
w._sva.setVisitorTraits({
toi_user_subscription_status: prime_user_status,
toi_user_geolocation: geoLocation,
toi_allowed_survicate_sections: allowedSurvicateSections
});
});
}

var s = document.createElement('script');
s.src = "https://survey.survicate.com/workspaces/0be6ae9845d14a7c8ff08a7a00bd9b21/web_surveys.js";
s.async = true;
var e = document.getElementsByTagName('script')[0];
e.parentNode.insertBefore(s, e);
})(window);
}
}

window.TimesApps = window.TimesApps || {};
var TimesApps = window.TimesApps;
TimesApps.toiPlusEvents = function(config) {
var isConfigAvailable = "toiplus_site_settings" in f && "isFBCampaignActive" in f.toiplus_site_settings && "isGoogleCampaignActive" in f.toiplus_site_settings;
var isPrimeUser = window.isPrime;
var isPrimeUserLayout = window.isPrimeUserLayout;

if (isConfigAvailable && !isPrimeUser) {
loadGtagEvents(f.toiplus_site_settings.isGoogleCampaignActive);
loadFBEvents(f.toiplus_site_settings.isFBCampaignActive);
loadSurvicateJs(f.toiplus_site_settings.allowedSurvicateSections);
} else {
var JarvisUrl = "https://jarvis.indiatimes.com/v1/feeds/toi_plus/site_settings/643526e21443833f0c454615?db_env=published";
getFromClient(JarvisUrl, function(config) {
if (config) {
const allowedSectionSuricate = (isPrimeUserLayout) ? config?.allowedSurvicatePrimeSections : config?.allowedSurvicateSections
loadGtagEvents(config?.isGoogleCampaignActive);
loadFBEvents(config?.isFBCampaignActive);
loadSurvicateJs(allowedSectionSuricate);
}
});
}
};
})(
window,
document,
'script',
);

function getFromClient(url, callback) {
var xhr = new xmlhttprequest();
xhr.open("GET", url, true);
xhr.onload

You may also like

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.