document.addEventListener("DOMContentLoaded", function() { const urlParams = new URLSearchParams(window.location.search); // Affiliate-ID aus Query holen, z.B. ?aff_id=XYZ const affiliateId = urlParams.get('aff_id'); if (affiliateId) { setCookie('affiliate_id', affiliateId, 365); } }); // Cookie setzen function setCookie(cName, cValue, expDays) { let date = new Date(); date.setTime(date.getTime() + (expDays * 24 * 60 * 60 * 1000)); const expires = "expires=" + date.toUTCString(); document.cookie = cName + "=" + encodeURIComponent(cValue) + "; " + expires + "; path=/"; } // Cookie lesen function getCookie(cName) { const name = cName + "="; const decodedCookie = decodeURIComponent(document.cookie); const ca = decodedCookie.split(';'); for (let c of ca) { c = c.trim(); if (c.indexOf(name) === 0) { return c.substring(name.length, c.length); } } return null; }

Show

Bitte akzeptiere Marketing-Cookies um diesen Inhalt anzuschauen.