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
|
||||
@@ -126,7 +126,7 @@ html
|
||||
a(href='https://github.com/contentful' target='_blank' rel='noopener')
|
||||
svg
|
||||
use(xlink:href='/icons/icons.svg#github')
|
||||
section.modal#about-this-modal
|
||||
section.modal#about-this-modal
|
||||
.modal__overlay.close
|
||||
.modal__wrapper
|
||||
h1.modal__title= translate("modalTitle", currentLocale.code)
|
||||
@@ -194,4 +194,5 @@ section.modal#about-this-modal
|
||||
|
||||
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>
|
||||
<script>
|
||||
script(async src="https://www.googletagmanager.com/gtag/js?id=UA-109296848-1")
|
||||
script.
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'UA-40725207-13');
|
||||
</script>
|
||||
<!-- Google Analytics end -->
|
||||
<!-- Snowplow starts plowing -->
|
||||
<script async>
|
||||
script(async).
|
||||
;(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[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
|
||||
@@ -42,5 +38,3 @@
|
||||
app_framework: 'nodejs'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!-- Snowplow stops plowing -->
|
||||
Reference in New Issue
Block a user