var gcode = "US"; var gcity = "Columbus"; var gcountry = "United States"; window.onload = function(){ if(gcity != ''){ var city_class = document.getElementsByClassName("city"); var ctry_class = document.getElementsByClassName("country"); for (var i = 0; i < city_class.length; i++) { city_class[i].innerHTML = gcity; } for (var x= 0; x < ctry_class.length; x++) { ctry_class[x].innerHTML = gcountry; } }else{ document.getElementsByClassName("city")[0].innerHTML = 'Your Area'; document.getElementsByClassName("country")[0].innerHTML = 'Your Country'; } } _paq.push([ function() { var p_ref; p_ref = this.getAttributionInfo(); var p_vars = p_ref.toString().split(","); var p_domain = p_vars[3]; var udomain = (new URL(p_domain)).hostname.replace('www.',''); usrDomain(udomain); }]); function usrDomain(vfrom) { window.onload = function(){ var elements = document.querySelectorAll('.xorigin'); elements.forEach(function(element){ element.value = vfrom; }); } }