Add analytics script (fixes #174) (#245)

This commit is contained in:
Surma
2018-11-09 18:53:10 +00:00
committed by Jake Archibald
parent 6994cc3d15
commit f562bad286
3 changed files with 29 additions and 0 deletions

View File

@@ -12,3 +12,12 @@ if (!('customElements' in self)) {
} else {
init();
}
window.ga = window.ga || ((...args) => (ga.q = ga.q || []).push(args));
ga('create', 'UA-128752250-1', 'auto');
ga('set', 'transport', 'beacon');
ga('send', 'pageview');
// Load the GA script
const s = document.createElement('script');
s.src = 'https://www.google-analytics.com/analytics.js';
document.head!.appendChild(s);