diff --git a/assets/google-analytics.coffee b/assets/google-analytics.coffee index 3a2f4be..c173ae4 100755 --- a/assets/google-analytics.coffee +++ b/assets/google-analytics.coffee @@ -1,6 +1,8 @@ +_getDomain = -> + window.location.hostname.match(/(?:www[0-9]?\.)?(.[^/:]+)/)[1] _gaq = _gaq or [] _gaq.push ["_setAccount", "UA-34001692-4"] -_gaq.push ["_setDomainName", "gov.br"] +_gaq.push ["_setDomainName", _getDomain] _gaq.push ["_trackPageview"] (-> ga = document.createElement("script") -- libgit2 0.21.2