refactor(tracking): conditional pug include instead of injection (#96)
This commit is contained in:
13
bin/vendor/deploy.sh
vendored
13
bin/vendor/deploy.sh
vendored
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
analytics_file="../bin/vendor/analytics.html"
|
|
||||||
layout_file="$(dirname $0)/../../views/layout.pug"
|
|
||||||
|
|
||||||
# Replace analytics script in layout
|
|
||||||
distro=`uname`
|
|
||||||
if [[ $distro != 'Linux' ]]; then
|
|
||||||
sed -i '' 's,'"<!--ANALYTICS-->,include $analytics_file"',g' "$layout_file"
|
|
||||||
else # If running on macOS, the sed command has different syntax
|
|
||||||
sed -i 's,'"<!--ANALYTICS-->,include $analytics_file"',g' "$layout_file"
|
|
||||||
fi
|
|
||||||
@@ -194,4 +194,5 @@ section.modal#about-this-modal
|
|||||||
|
|
||||||
script(src='/scripts/index.js')
|
script(src='/scripts/index.js')
|
||||||
|
|
||||||
<!--ANALYTICS-->
|
if process.env.TRACKING
|
||||||
|
include ./tracking.pug
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
<!-- Google Analytics -->
|
script(async src="https://www.googletagmanager.com/gtag/js?id=UA-109296848-1")
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-109296848-1"></script>
|
script.
|
||||||
<script>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag(){dataLayer.push(arguments);}
|
function gtag(){dataLayer.push(arguments);}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
|
|
||||||
gtag('config', 'UA-40725207-13');
|
gtag('config', 'UA-40725207-13');
|
||||||
</script>
|
script(async).
|
||||||
<!-- Google Analytics end -->
|
|
||||||
<!-- Snowplow starts plowing -->
|
|
||||||
<script async>
|
|
||||||
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
|
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
|
||||||
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
|
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
|
||||||
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
|
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
|
||||||
@@ -42,5 +38,3 @@
|
|||||||
app_framework: 'nodejs'
|
app_framework: 'nodejs'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
<!-- Snowplow stops plowing -->
|
|
||||||
Reference in New Issue
Block a user