projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f6f131
)
Added async version of Google Analytics internal template
author
Wade Fitzpatrick
<wade@waddles.org>
Thu, 17 Dec 2015 05:56:16 +0000
(15:56 +1000)
committer
Steve Francia
<steve.francia@gmail.com>
Mon, 4 Jan 2016 15:33:18 +0000
(10:33 -0500)
tpl/template_embedded.go
patch
|
blob
|
history
diff --git
a/tpl/template_embedded.go
b/tpl/template_embedded.go
index b54f92e7eb447e9a26a49c24e1752fd6191964fe..a2fde4b10705eefc5498027b0daaf9651e83a7f8 100644
(file)
--- a/
tpl/template_embedded.go
+++ b/
tpl/template_embedded.go
@@
-232,5
+232,14
@@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
</script>
+{{ end }}`)
+
+ t.AddInternalTemplate("", "google_analytics_async.html", `{{ with .Site.GoogleAnalytics }}
+<script>
+window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
+ga('create', '{{ . }}', 'auto');
+ga('send', 'pageview');
+</script>
+<script async src='//www.google-analytics.com/analytics.js'></script>
{{ end }}`)
}