Permalink
Browse files

set domain name for google analytics

  • Loading branch information...
1 parent 63fa1a2 commit a6e2744c10716e03385330d7a0cd0147a4bcb2a1 @sublee committed Apr 3, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 subleebase/layout.html
View
@@ -35,8 +35,12 @@
</div>
{% if theme_google_analytics %}
<script>
+ var domainMatch = /https?:\/\/([^\/]+)/.exec(location.href);
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ theme_google_analytics }}']);
+ if (domainMatch) {
+ _gaq.push(['_setDomainName', domainMatch[1]]);
+ }
_gaq.push(['_trackPageview']);
(function() {
var isHTTPS = 'https:' == document.location.protocol;

0 comments on commit a6e2744

Please sign in to comment.