mirror of
https://github.com/seigler/dash-website
synced 2025-07-27 07:16:10 +00:00
Add analytics to site templates
This commit is contained in:
parent
45ec8c0fa3
commit
17c4462464
4 changed files with 80 additions and 55 deletions
3
_includes/analytics-noscript.html
Normal file
3
_includes/analytics-noscript.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<noscript>
|
||||
<img src="https://analytics.dash.org/piwik.php?idsite=1&rec=1" style="border:0" alt="" />
|
||||
</noscript>
|
12
_includes/analytics-script.html
Normal file
12
_includes/analytics-script.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//analytics.dash.org/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', '1']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
|
@ -14,6 +14,8 @@
|
|||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/dist/css/main.min.css">
|
||||
<!-- Analytics -->
|
||||
{% include analytics-script.html %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -30,6 +32,9 @@
|
|||
{% include nav-mobile.html %}
|
||||
</div>
|
||||
|
||||
<!-- Fallback analytics -->
|
||||
{% include analytics-noscript.html %}
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script src="//cdn.jsdelivr.net/lodash/4.12.0/lodash.min.js" integrity="sha384-MYg5v6RiLsgqDiKOs6hcDXVblLg+Ls5F/jimSFosIUeDjW5VYViY1eMBMazbV5Mr" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" integrity="sha384-CgeP3wqr9h5YanePjYLENwCTSSEz42NJkbFpAFgHWQz7u3Zk8D00752ScNpXqGjS" crossorigin="anonymous"></script>
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/dist/css/main.min.css">
|
||||
<!-- Analytics -->
|
||||
{% include analytics-script.html %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -70,6 +72,9 @@
|
|||
{% include nav-mobile.html %}
|
||||
</div>
|
||||
|
||||
<!-- Fallback analytics -->
|
||||
{% include analytics-noscript.html %}
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script src="//cdn.jsdelivr.net/lodash/4.12.0/lodash.min.js" integrity="sha384-MYg5v6RiLsgqDiKOs6hcDXVblLg+Ls5F/jimSFosIUeDjW5VYViY1eMBMazbV5Mr" crossorigin="anonymous"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" integrity="sha384-CgeP3wqr9h5YanePjYLENwCTSSEz42NJkbFpAFgHWQz7u3Zk8D00752ScNpXqGjS" crossorigin="anonymous"></script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue