(function () {
// Only run on /daftar-03/ or /register
const path = window.location.pathname.replace(/\/+$/, '');
if (path !== '/register') {
return;
}
const params = new URLSearchParams(window.location.search);
const clickId = params.get('myclick');
if (!clickId) {
return;
}
if (clickId.length > 500) {
return;
}
const maxAge = 30 * 24 * 60 * 60;
document.cookie =
'vl-cid=' + encodeURIComponent(clickId) +
'; Path=/' +
'; Max-Age=' + maxAge +
'; SameSite=Lax' +
(location.protocol === 'https:' ? '; Secure' : '');
try {
localStorage.setItem('vl-cid', clickId);
} catch (e) {}
})();