1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-02-14 21:10:25 +01:00

output individual analytics script

This commit is contained in:
Matthias Kretschmann 2017-09-09 19:34:38 +02:00
parent c3abc79d2d
commit c031a063f0
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 13 additions and 13 deletions

View File

@ -69,10 +69,14 @@ const krlcAnalytics = (() => { // eslint-disable-line no-unused-vars
return {
init: [
gaBreakpoints(),
gaViewport(),
gaPixelDensity()
]
init() {
const dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack
if (dnt !== 'yes' && dnt !== '1') {
gaBreakpoints()
gaViewport()
gaPixelDensity()
}
}
}
})(); // eslint-disable-line semi

View File

@ -1,4 +1,4 @@
/* global krlcMenu, krlcSearch, krlcModals, krlcAnalytics, svg4everybody */
/* global krlcMenu, krlcSearch, krlcModals, svg4everybody */
/* eslint-disable spaced-comment */
//=require webcomponents.js/CustomElements.js
@ -9,7 +9,6 @@
//=include _menu.js
//=include _search.js
//=include _modals.js
//=include _analytics.js
/* eslint-enable spaced-comment */
@ -27,12 +26,6 @@ $(document).ready(() => {
//
krlcModals.init()
const dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack
if (dnt !== 'yes' && dnt !== '1') {
krlcAnalytics.init()
}
svg4everybody({
nosvg: false
})

View File

@ -69,3 +69,5 @@
{% else %}
<script async src="//www.google-analytics.com/analytics_debug.js"></script>
{% endif%}
<script src="/assets/js/analytics.min.js" async></script>

View File

@ -214,6 +214,7 @@ export const criticalCss = done => {
export const js = () =>
src([
SRC + '/_assets/js/kremalicious3.js',
SRC + '/_assets/js/analytics.js',
'node_modules/picturefill/dist/picturefill.js'
])
.pipe($.sourcemaps.init())