function generateUniqSerial() { return 'xxxx-xxxx-xxx-xxxx'.replace(/[x]/g, function (c) { var r = Math.floor(Math.random() * 16); return r.toString(16); }); } function getParam(p) { var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search); return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); } var msclkid = getParam('_uetmsclkid'); var img = document.createElement('img'); img.src = "https://bat.bing.com/action/0?ti=150000104&ver=2.3&evt=pageLoad&rn=".concat(Math.floor(Math.random() * 90000) + 100000, "&mid=").concat(generateUniqSerial(), "&msclkid=").concat(msclkid); img.height = '1'; img.width = '1'; img.style.display = 'none' document.body.appendChild(img);