function loadSurvicateJs(allowedSurvicateSections = []){ const section = window.location.pathname.split('/')[1] const isHomePageAllowed = window.location.pathname === '/' && allowedSurvicateSections.includes('homepage')

if(allowedSurvicateSections.includes(section) || isHomePageAllowed){ (function(w) { 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; 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"; window.getFromClient(JarvisUrl, function(config){ if (config) { loadGtagEvents(config?.isGoogleCampaignActive); loadFBEvents(config?.isFBCampaignActive); loadSurvicateJs(config?.allowedSurvicateSections); } }) } }; })( window, document, 'script', );

Leave a Reply

Your email address will not be published. Required fields are marked *