mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 01:37:26 +00:00
Preload test (#262)
* Preload test * Don't prerender analytics * Version bump
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@@ -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": {
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
18
src/index.ts
18
src/index.ts
@@ -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);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user