Central PA Native Information, Breaking Information, Sports activities & Climate

0; pvCount = pvCount + 1; window.adiData.pvCount = pvCount; localStorage.setItem(‘pvCounter’, window.adiData.pvCount); // Get a localstorage worth that has an expiry date, take away it if expired – first used for REVGEN-1096 const getLSwExpiryDate = (key) => { const lsValue = localStorage.getItem(key); if (!lsValue) { return null; } const LSitem = JSON.parse(lsValue); const now = new Date(); if (now.getTime() > LSitem.expires) { localStorage.removeItem(key); return null; } return LSitem.worth; } const trackFlyby = () => { const pageViews = window.adiData.pvCount; let flybyValue = “true”; const flybyExists = getLSwExpiryDate(‘ls-alt-flyby’); if (pageViews >= 3 && flybyExists !== null) { flybyValue = “false”; window.adiData.rg_flyby = flybyValue; } else { window.adiData.rg_flyby = flybyValue; } } if (window.adiData.pageType === ‘cal’) { countPV(); trackFlyby(); } ]]>

Leave a Reply

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