var soicos = { serialize_dic : function (a,dic_name) { var s = []; for ( var j in a ) {s.push( dic_name + "["+j+"]" + "=" + encodeURIComponent( a[j] ) );} return s.join("&"); }, gup : function (name) { match = RegExp("[?&]"+name+"=([^&]*)").exec(window.location.href); return match && decodeURIComponent(match[1]); }, wjs : function(url){ var t = document.createElement("script"); t.setAttribute("src", url); t.setAttribute("type","text/javascript"); document.body.appendChild(t); }, getCookie(name) { var re = new RegExp(name + "=([^;]+)"); var value = re.exec(document.cookie); return (value != null) ? unescape(value[1]) : null; }, registerConversion : function (conversion) { var conv = soicos.conversion = conversion; var trans = soicos.serialize_dic(soicos.conversion.trans,"trans"); var s = []; if(soicos.conversion.items) { for(var i=0; i < soicos.conversion.items.length; i++) { s.push(soicos.serialize_dic(soicos.conversion.items[i],"items["+i+"]")); } } var items = s.join("&"); var data = "data=" + encodeURI(conv.data); var attr = soicos.serialize_dic(soicos.conversion.attributes, "attr"); var conv_arr = []; var tmp_arr = [data, trans, items, attr]; var pids_journey = [ 12221, 15223, 14856 ]; if ( pids_journey.includes( conv.pid ) && soicos.getCookie( 'soicos_attr_source_cookie' ) != "soicos" ) return; for(var i=0; i < tmp_arr.length; i++) if(tmp_arr[i]) conv_arr.push(tmp_arr[i]); if (!conv.fd || conv.fd == 1) { var _js = "https://ad.soicos.com/conv.php?pid="+conv.pid +"&"+ conv_arr.join("&") + "&s=.js"; soicos.wjs(_js); } if (!conv.fd || conv.fd == 2) { var _js = "https://soi.me/conv.php?pid="+conv.pid +"&"+ conv_arr.join("&") + "&s=.js"; soicos.wjs(_js); } } };