function anonymous( ) { ayManagerEnv.settings.experiments = { apsMultiFormat: true, destroyFarUnitsAboveSightOnly: true, }; window.ayManagerEnv.checkIfAdUnitIsVisible = false; window.ayManagerEnv.__getLayout = function () { var path = window.location.pathname; var page = path.split('/')[1]; switch (page) { case '': return 'home'; case 'gag': return 'post'; default: return page; } }; // pubX var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'https://cdn.pbxai.com/dcd44e4d-5fce-4ac8-bf04-0663b18bded0.js'; document.head.appendChild(script); window.addEventListener("assertive_logImpression", function (e) { try { var payload = e.data.payload; if (payload.dfpTargetingMap) { var tm = payload.dfpTargetingMap; var pubxA = tm["pubx-a"] && tm["pubx-a"][0]; var pubxFloor = tm["pubx-floor"] && tm["pubx-floor"][0]; payload.custom_2 = pubxA; // on vs off payload.custom_3 = pubxFloor; // floor key/value } } catch (e) { console.error(e); } }); window.YM_SPLIT_TESTS = { S2S: { percentage: 95, dimension: "custom_12" }, /* safeframe: { percentage: 50, dimension: "custom_11", addToHash: false }, */ parallel: { percentage: 50, dimension: "custom_11" }, video: { variants: { primis: 20, vidazoo: 20, aniview: 20, banner: 20, control: 20, }, dimension: "custom_14" }, }; (function(){ var getCookie = function(name) { return ('; '+document.cookie).split(`; ${name}=`).pop().split(';')[0]; } var setCookie = function(name, value, exDays) { var d = new Date(); d.setTime(+d+exDays*864e5); var exp = "expires=" + d.toUTCString(); document.cookie = `${name}=${value};path=/;${exp};`; } function getRandomVariant(variants) { let variantsMap = []; Object.keys(variants).forEach(function(variant) { variantsMap.push({ name: variant, percentage: variants[variant] }); }); // sort variants by percentage in ascending order variantsMap.sort(function(a, b) { return (a.percentage > b.percentage) ? 1 : (a.percentage < b.percentage) ? -1 : 0; }); let start = 0; var random = Math.floor(Math.random() * 100); for (var variant of variantsMap) { // get range from percentage var end = start + variant.percentage; if (random >= start && random < end) { return variant.name; } start = end; } } window.assertiveQueue = window.assertiveQueue || []; Object.keys(YM_SPLIT_TESTS).forEach(function(testName) { var test = YM_SPLIT_TESTS[testName]; if (!test.variants) { test.variants = { on: test.percentage, off: 100 - test.percentage } } var cookieKey = "aym_t_" + testName; var cookie = getCookie(cookieKey); var value; if (cookie) { if (test.variants[cookie]) { value = cookie; } } if (value === undefined) { value = getRandomVariant(test.variants); setCookie(cookieKey, value); } if ('URLSearchParams' in window) { var urlParams = new URLSearchParams(window.location.search); var param = urlParams.get('split_' + testName); if (param) { value = param; setCookie(cookieKey, value); } } test.value = value; window.assertiveQueue.push(function () { assertive.setConfig('analytics.custom.' + test.dimension, value + '-' + testName); }); }); var hashValues = []; Object.keys(YM_SPLIT_TESTS).forEach(function(testName) { if (YM_SPLIT_TESTS[testName].addToHash !== false) { hashValues.push(testName + ':' + YM_SPLIT_TESTS[testName].value); } }); YM_SPLIT_TESTS.hashValues = hashValues; })(); }