mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Display Cookie Disclaimer & Add Analytics
Display the cookie disclaimer to visitors. Add analytics to the site unless the user has Do Not Track enabled.
This commit is contained in:
parent
550ff42390
commit
67bbe0ca12
2 changed files with 19 additions and 0 deletions
|
@ -18,3 +18,16 @@ http://opensource.org/licenses/MIT.
|
|||
{% if page.id != 'download' %}<script type="text/javascript" src="/js/main.js"></script>{% endif %}
|
||||
<link rel="shortcut icon" href="/favicon.png">
|
||||
<link rel="apple-touch-icon-precomposed" href="/img/icons/logo_ios.png"/>
|
||||
<script>
|
||||
window.cookieconsent_options = {
|
||||
theme: 'light-floating'
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="/js/cookieconsent/cookieconsent.js"></script>
|
||||
<script>
|
||||
if( navigator.doNotTrack != "yes" && navigator.doNotTrack != "1" && window.doNotTrack != "1" && navigator.msDoNotTrack != "1" ){
|
||||
var script = document.createElement('script');
|
||||
script.src = '/js/analytics.js'
|
||||
document.getElementsByTagName("head")[0].appendChild(script);
|
||||
}
|
||||
</script>
|
||||
|
|
6
js/analytics.js
Normal file
6
js/analytics.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
(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','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-46627233-1', 'auto');
|
||||
ga('send', 'pageview');
|
Loading…
Add table
Add a link
Reference in a new issue