var camper_num = ""; //if("" != "") camper_num = ""; var url="https://conv.digitalcamp.co.kr/tk_saveinfo.php?c_num=" + camper_num+"&ucode_yn="+""+"&cp="+"t"+"&adbid="+""+"&curl="+encodeURIComponent(window.location.href)+"&cref="+encodeURIComponent(document.referrer); var xhr = new XMLHttpRequest(); xhr.open("GET", encodeURI(url), true); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200){}else{} } xhr.send(); function setCookie(name, value, days) {var expires = "";if (days) {var date = new Date();date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));expires = "; expires=" + date.toUTCString();}document.cookie = "__Host-" + name + "=" + value + expires + "; Secure; Path=/; SameSite=None; Partitioned;";} function getCookie(name) {var nameEQ = "__Host-" + name + "=";var cookies = document.cookie.split(';');for(var i = 0; i < cookies.length; i++) {var cookie = cookies[i];while (cookie.charAt(0) === ' ') {cookie = cookie.substring(1, cookie.length);}if (cookie.indexOf(nameEQ) === 0) {return cookie.substring(nameEQ.length, cookie.length);}}return null;} //location의 쿼리에서 dccparam(CLICK UCODE)값을 가져옴 var queryString = window.location.search; var urlParams = new URLSearchParams(queryString); var dccparam = urlParams.get('dccparam'); //없으면 null 반환 if(dccparam != null && dccparam != ''){ setCookie("DCAMPUDATA_DATE", dccparam, 60); } var dcamp_udata = getCookie("DCAMPUDATA_DATE"); if(dcamp_udata == null) dcamp_udata = ""; function dcampconv(event_name, event_value){ if(event_name != "" && typeof event_value === 'object'){ var ocp = 't'; var cp_txt = ''; var cate = ''; var ev = JSON.stringify(event_value); ev = ev.replace(/&/g,' '); var ucode = camper_num; if(t == "1256" && (event_name == "participation" || event_name == "purchase") ) { ocp = '157'; cp_txt = ''; cate = ''; var url="https://conv.digitalcamp.co.kr/tk_saveinfo.php?c_num=" + camper_num+"&ucode_yn="+""+"&cp=157"+"&adbid="+""+"&curl="+encodeURIComponent(window.location.href)+"&cref="+encodeURIComponent(document.referrer); var xhr = new XMLHttpRequest(); xhr.open("GET", encodeURI(url), true); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200){}else{} } xhr.send(); } if(cp_txt != "") { //==========================하나투어 구매전환시 URL 파싱에서 정보 얻기(예약번호, 가격)============================== if(ocp == "939" && event_name == "PURCHASE"){ var urlString = window.location.href; var url = new URL(urlString); //path의 마지막 인자값 가져오기(예약번호) var pathArray = url.pathname.split('/'); var transactionid = pathArray[pathArray.length - 1]; //쿼리 파라미터 중 금액 값 가져오기(금액) var searchParams = new URLSearchParams(url.search); var totalprice = searchParams.get("bankAmount"); if(transactionid !== '' && totalprice !== ''){ var jsonObject = JSON.parse(ev); jsonObject.transaction_id = transactionid; jsonObject.total_price = totalprice; // 수정된 JavaScript 객체를 JSON 문자열로 변환 ev = JSON.stringify(jsonObject); } } //========================================================================================================= //console.log(ev, event_value); var url="https://conv.digitalcamp.co.kr/tk_conv.php?cp="+cp_txt+"&en="+event_name+"&ev="+ev+"&ocp="+ocp+"&uc="+ucode+"&cid="+dcamp_udata+"&ca="+cate; var xhr = new XMLHttpRequest(); xhr.open("GET", encodeURI(url), true); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200){} } xhr.send(); sleep_dc(200);//사파리에서 동작안하는 문제 } } } function sleep_dc(ms) { const wakeUpTime = Date.now() + ms; while (Date.now() < wakeUpTime) {} }