// Conversion tracking guide (/conversion-tracking, 2026-10-24): the Copy buttons on the code examples, and inside a // traffic-exchange frame (session and sponsor cookies are dropped there) sign-in, join, Control Room and off-site links // open in a new tab, /join carrying the ?ref= this page was opened with (same rule as refuel-guide.js). (function () { function flash(b, t) { var o = b.getAttribute('data-label') || b.textContent; b.setAttribute('data-label', o); b.textContent = t; setTimeout(function () { b.textContent = o; }, 1600); } document.querySelectorAll('[data-copy]').forEach(function (b) { b.addEventListener('click', function () { var box = b.closest('.cg-code'); var pre = box && box.querySelector('pre'); if (!pre) return; var text = pre.textContent; var fallback = function () { try { var r = document.createRange(); r.selectNodeContents(pre); var s = window.getSelection(); s.removeAllRanges(); s.addRange(r); var ok = document.execCommand && document.execCommand('copy'); flash(b, ok ? 'Copied' : 'Selected'); } catch (e) { flash(b, 'Select and copy'); } }; try { if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(text).then(function () { flash(b, 'Copied'); }, fallback); else fallback(); } catch (e) { fallback(); } }); }); var framed = false; try { framed = window.top !== window.self; } catch (e) { framed = true; } if (!framed) return; var ref = ''; try { ref = new URLSearchParams(location.search).get('ref') || ''; } catch (e) {} ref = String(ref).toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 40); document.querySelectorAll('a[href]').forEach(function (a) { var h = a.getAttribute('href') || ''; if (h.charAt(0) === '#') return; var member = a.host === location.host && /^\/(join|credits|ads|links|sources|conversions|signin|login)(\/|$)/.test(a.pathname); if (member && ref && a.pathname === '/join' && !/[?&]ref=/.test(a.search)) a.search = (a.search ? a.search + '&' : '?') + 'ref=' + ref; if (member || a.host !== location.host) { a.target = '_blank'; a.rel = 'noopener'; } }); })();