var bdvGlobal = {}; (function() { var ref = document.referrer; if ( ref ) { var match = ref.match(/^(http://|https://)([^?]+)/); if (match) { ref = match[2]; } bdvGlobal.referer = ref; } }());