Preload test (#262)

* Preload test

* Don't prerender analytics

* Version bump
This commit is contained in:
Jake Archibald
2018-11-10 08:20:13 -08:00
committed by GitHub
parent 6870b135b7
commit a1a00f0bfb
3 changed files with 12 additions and 10 deletions

View File

@@ -13,11 +13,13 @@ if (!('customElements' in self)) {
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);
if (typeof PRERENDER === 'undefined') {
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);
}