Movatterモバイル変換


[0]ホーム

URL:


${str}`, 'text/html'); return dom.body.textContent || ''; }; const isMobileOnly = window.matchMedia('(max-width: 767px)').matches; const userProfileCookie = document.cookie .split('; ') .find(row => row.startsWith('USER_PROFILE=')) ?.split('=')[1]; const userSubscriptionDetails = document.cookie .split('; ') .find(row => row.startsWith('US_SD=')) ?.split('=')[1]; const userId = userProfileCookie ? JSON.parse(decodeURIComponent(userProfileCookie)).userId : null; const existingUserCookie = document.cookie .split('; ') .find(row => row.startsWith('ExiUs=')); const existingUser = existingUserCookie ? existingUserCookie.split('=')[1] === 'true' : false; const subscriptionStatus = userSubscriptionDetails ? JSON.parse(decodeURIComponent(userSubscriptionDetails))?.status : null; const initialLogin = JSON.parse(window.localStorage.getItem('initialLogin') || 'false'); const localIsLoggedIn = JSON.parse(window.localStorage.getItem('isLoggedIn') || 'false'); const loginType = localIsLoggedIn ?'logged-in':'logged-out'; const userStatus = userId?(subscriptionStatus ==='active'?'subscriber':'non-subscriber'):'non-subscriber'; let userType; if (!localIsLoggedIn) { userType = existingUser ? 'logged-out' : 'guest'; } else if (subscriptionStatus === 'active') { userType = 'subscriber'; } else { userType = 'logged-in'; } if (!initialLogin) { if (typeof window !== 'undefined') { window.googletag = window.googletag || { cmd: [] }; window.googletag.cmd.push(() => { if (window.googletag.pubads && typeof window.googletag.pubads === 'function') { const cookieName = 'PPIDProfit'; const cookieDays = 180; let cookieValue = null; const cookieArr = document.cookie.split(';'); for (let i = 0; i< cookieArr.length; i++) { const cookiePair = cookieArr[i].split('='); if (cookieName === cookiePair[0].trim()) { cookieValue = decodeURIComponent(cookiePair[1]); break; } } if (!cookieValue) { const generateString = (length) => 'publisherprovidedids' + Math.floor(Math.pow(10, length - 1) + Math.random() * 9 * Math.pow(10, length - 1)) + 'ndtvprofitids'; cookieValue = generateString(9); // Set the new cookie const date = new Date(); date.setTime(date.getTime() + cookieDays * 24 * 60 * 60 * 1000); const expires = '; expires=' + date.toUTCString(); document.cookie = cookieName + '=' + cookieValue + expires + '; path=/'; } window.localStorage.setItem('PPIDProfit', cookieValue); googletag.pubads().setPublisherProvidedId(cookieValue); googletag.pubads().enableLazyLoad({ fetchMarginPercent: 100, renderMarginPercent: 200, }); if (pageType === 'story-page') { let pageviewEvent = { event: 'pageview', login_type: loginType || 'NA', user_status: userStatus || 'NA', user_type: userType ||'NA', page_template: 'story', PPID: window.localStorage.getItem('PPIDProfit') || cookieValue ||'NA', page_title: decodeHTML("NA"), authors: "NA", agency: "NDTV Profit", category: window.location.pathname.substring(1).split('/')[0], cmsid: "", published_date: "", published_time: "null IST", last_update_date: "NA", page_access: "", content_word_count: "", content_read_count: "", keywords: "NA", ContentSource: "NDTV Profit", articleAge: "NA days", publicationYear: "NA", publicationmonth: "NA", published_day: "", language_hit: 'english', Platform: isMobileOnly ? 'mobile' : 'desktop', SiteName: 'https://www.ndtvprofit.com' }; // Conditionally add userId if it's not null/undefined if (userId) { pageviewEvent.user_id = userId; } window.dataLayer.push(pageviewEvent); console.log("✅ pageview triggered"); } else { let pageviewEvent = { event: 'pageview', login_type: loginType || 'NA', user_status: userStatus || 'NA', user_type: userType ||'NA', page_template: "home-page", category: category, PPID: window.localStorage.getItem('PPIDProfit') || cookieValue || 'NA', language_hit: 'english', Platform: isMobileOnly ? 'mobile' : 'desktop', SiteName: 'https://www.ndtvprofit.com' }; // Conditionally add userId if it's not null/undefined if (userId) { pageviewEvent.user_id = userId; } window.dataLayer.push(pageviewEvent); console.log("✅ pageview triggered"); } } }); } }
NDTV ProfitNDTV Profit
NDTV Profit
More from NDTV Profit
Sports
Space & Science
Nation
World
Web Stories
Pursuits
Politics
FOLLOW NDTV Profit ON
NDTV Profit
NDTV Profit
NDTV Profit
NDTV Profit
NDTV Profit
NDTV Profit
DOWNLOAD THE APP
NDTV Profit
NDTV Profit
v1.0.1
Made withby Business Experts
NDTV Profit
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Follow Us
Note : All Stock Exchange data is delayed upto 3 mins
scanner
DOWNLOAD THE APP
play-storeapp-store

[8]ページ先頭

©2009-2025 Movatter.jp