shithub: hugo

Download patch

ref: 4ed1228d55aa33bc2b3c399fc592b6887e22df5e
parent: a51945ea4b99d17501d73cf3367926683e4a4dfd
author: Bjørn Erik Pedersen <[email protected]>
date: Fri May 25 12:05:45 EDT 2018

Fix GA anonymizeIp order

--- a/tpl/tplimpl/embedded/templates.autogen.go
+++ b/tpl/tplimpl/embedded/templates.autogen.go
@@ -123,8 +123,8 @@
 	{{ else }}
 	ga('create', '{{ . }}', 'auto');
 	{{ end -}}
+	{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end }}
 	ga('send', 'pageview');
-	{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
 }
 </script>
 {{ end }}
@@ -159,8 +159,8 @@
 	{{ else }}
 	ga('create', '{{ . }}', 'auto');
 	{{ end -}}
+	{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end }}
 	ga('send', 'pageview');
-	{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
 }
 </script>
 <script async src='//www.google-analytics.com/analytics.js'></script>
--- a/tpl/tplimpl/embedded/templates/google_analytics.html
+++ b/tpl/tplimpl/embedded/templates/google_analytics.html
@@ -22,8 +22,8 @@
 	{{ else }}
 	ga('create', '{{ . }}', 'auto');
 	{{ end -}}
+	{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end }}
 	ga('send', 'pageview');
-	{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
 }
 </script>
 {{ end }}
--- a/tpl/tplimpl/embedded/templates/google_analytics_async.html
+++ b/tpl/tplimpl/embedded/templates/google_analytics_async.html
@@ -19,8 +19,8 @@
 	{{ else }}
 	ga('create', '{{ . }}', 'auto');
 	{{ end -}}
+	{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end }}
 	ga('send', 'pageview');
-	{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
 }
 </script>
 <script async src='//www.google-analytics.com/analytics.js'></script>