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

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "squoosh", "name": "squoosh",
"version": "0.1.0", "version": "1.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "squoosh", "name": "squoosh",
"version": "1.0.0", "version": "1.0.1",
"license": "apache-2.0", "license": "apache-2.0",
"scripts": { "scripts": {
"start": "webpack serve --host 0.0.0.0 --hot", "start": "webpack serve --host 0.0.0.0 --hot",

View File

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