Skip to content

Commit

Permalink
Added analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Aug 15, 2016
1 parent 3f2ae7b commit b89b693
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/content/snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ footer: |
* * *
This website is made with [_jqt_](https://fadado.github.io/jqt/).\
_jqt_ is licensed under the MIT license (code) and the
[CC-BY-3.0](https://creativecommons.org/licenses/by/3.0/) license (docs).
[CC-BY-3.0](https://creativecommons.org/licenses/by/3.0/) license (documents).
toc-title: Table of contents

Expand Down
2 changes: 2 additions & 0 deletions docs/structure/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ <h1>{{.snippets.title}}</h1>
<div id="FOOTER">
<%include "footer.html">
</div>

<%partial analytics 'UA-82432866-1'>&
</body>
</html>
<#
Expand Down
24 changes: 23 additions & 1 deletion share/analytics.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<#
# Usage: <%partial analytics UA-8673551-2>
# Usage: <%partial analytics UA-82432866-1>
#
# $1: analytics UA
#>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '$1', 'auto');
ga('send', 'pageview');
</script>
<# OLD VERSION
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(["_setAccount", "$1"]);
Expand All @@ -16,6 +25,19 @@
s.parentNode.insertBefore(ga, s);
})();
</script>
#>
<# LAST VERSION
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-82432866-1', 'auto');
ga('send', 'pageview');

</script>
#>
<#
vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=html
#>

0 comments on commit b89b693

Please sign in to comment.