response.json()) .then(data => data.uuid) .catch(error => console.warn(‘There was an error!’, error)) : Promise.resolve(uuid) ).then(uuid => { console.log(‘uuid from ID ppid api:’, uuid); var date = new Date(); date.setTime(date.getTime() + (180 * 24 * 60 * 60 * 1000)); var expires = ‘expires=’ + date.toUTCString(); var path = ‘path=/’; var cookieString = ‘SUID=’ + [uuid, expires, path].join(‘; ‘); var sameSiteSecure = undefined ? ‘; SameSite=None; Secure’ : ”; console.log(‘ppid cookie string ‘, cookieString + sameSiteSecure); document.cookie = cookieString + sameSiteSecure; if (uuid) { window.dataLayer.push({ ‘event’: ‘user_id’, ‘user_id’: uuid, ‘test’: true }); } }) ]]> ]]> -1) { isBlocked = true; } return isBlocked; } })(); ]]> 0 ? adsBlocked : true; // If height ]]> -1) { return “gallery”; } else if (path.indexOf(“/weather”) === 0) { // Includes all subsections of /weather, per request return “weather”; } else if (path.indexOf(“/traffic”) === 0) { // Includes all subsections of /traffic, per request return “traffic”; } else if (path.indexOf(“/watch”) === 0 || path.indexOf(“/watch-beta”) === 0) { // Includes watch and watch-beta pages return “watch”; } // All other sections should report as simply “section” return “section”; } ]]> -1; } // command = ‘getUSPData’, version = 1, callback = function(uspData: uspdata, success: boolean) window.__uspapi = function (command, version, callback) { if (command === ‘getUSPData’ && version === 1) { if (isFullMeasure() || getPrivacyKVP()) { // enable via KVP or if the site is fullmeasure.news // check trustarc for privacy info var uspString = getTrustArc(); if (uspString) { // if the uspString was created and returned properly // Then perform callback with correct object var uspData = { version: version, uspString: uspString }; return callback(uspData, true); } } } // Case where command !== getUSPData || uspString returns null || version !== 1 || !usPrivacyEnabled // call callback…
Continue reading
