Google Analytics

This commit is contained in:
Ian Gulliver
2018-12-08 01:15:12 +00:00
parent 812a1ab529
commit 7d5f7a502c
2 changed files with 11 additions and 0 deletions

View File

@@ -9,6 +9,15 @@
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="passmate.css">
<script src="passmate.js" async></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130661405-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-130661405-1');
</script>
</head>
<body>

View File

@@ -109,6 +109,8 @@ class PassMate {
let print = this.addElement('button', printStep, 'Click here to print the book!');
print.style.cursor = 'pointer';
printStep.addEventListener('click', () => {
let ga = window.ga || () => {};
ga('send', 'event', 'Overview', 'print');
window.print();
});