control Google Analytics ID with ENV variable

This commit is contained in:
Bilal Catic
2019-10-10 17:39:13 +02:00
parent 549ab4e5e4
commit 73a39bcd0a
2 changed files with 7 additions and 6 deletions

View File

@@ -2,12 +2,12 @@
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-149713678-1"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= process.env.GA_ID %>"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-149713678-1');
gtag('config', '<%= process.env.GA_ID %>');
</script>
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">