var cookiedomain = getDomain(document.domain); var paramobj = {}; if (typeof getParam('ecaiad') !== 'undefined') { document.cookie = 'ecaiad=' + getParam('ecaiad'); } var arr = getCookieArray(); $(function(){ if (getParam('ecaiad')) paramobj['ecaiad'] = getParam('ecaiad'); if (getParam('tcd')) paramobj['tcd'] = getParam('tcd'); if (getParam('ccid')) paramobj['ccid'] = getParam('ccid'); if (getParam('coid')) paramobj['coid'] = getParam('coid'); if (getParam('csid')) paramobj['csid'] = getParam('csid'); if ($('#cv').length > 0) paramobj['cv'] = $('#cv').attr('value'); if (window.location.href) paramobj['url'] = window.location.href; if (paramobj) var query = '?' + Object.entries(paramobj).map((e) => `${e[0]}=${e[1]}`).join('&'); $.getScript("https://licom.ecai.jp/aclog"+query); }) function getParam(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } function getDomain(url) { var arr_uri = url.match(/^(.*?)([a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})[\:[0-9]*]?([\/].*?)?$/i); return arr_uri[2]; } function getCookieArray() { var arr = new Array(); if (document.cookie != '') { var tmp = document.cookie.split('; '); for (var i = 0; i < tmp.length; i++) { var data = tmp[i].split('='); arr[data[0]] = decodeURIComponent(data[1]); } } return arr; }