Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use google analytics #754

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Don't use google analytics
  • Loading branch information
camillobruni committed Apr 2, 2024
commit 98a14d27a1122a5aaaac9d922246e17f01cac5bb
13 changes: 0 additions & 13 deletions src/_js/legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,4 @@
history.replaceState({}, '', location.pathname);
}

// Google Analytics.
var UA_ID = 'UA-65961526-1';
self.GoogleAnalyticsObject = 'ga';
self.ga = function() {
ga.q.push(arguments);
};
ga.l = +new Date();
ga.q = [];
ga('create', UA_ID, 'auto');
ga('set', 'referrer', document.referrer.split('?')[0]);
ga('send', 'pageview');
insertScript('https://www.google-analytics.com/analytics.js');

}());
15 changes: 0 additions & 15 deletions src/_js/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,3 @@ if (location.search.includes('utm_source')) {
// set the location to `location.pathname` directly.
history.replaceState({}, '', location.pathname);
}

// Google Analytics.
const UA_ID = 'UA-65961526-1';
self.GoogleAnalyticsObject = 'ga';
self.ga = (...args) => {
ga.q.push(args);
};
ga.l = Date.now();
ga.q = [];
ga('create', UA_ID, 'auto');
ga('set', 'referrer', document.referrer.split('?')[0]);
ga('send', 'pageview');
const gaScript = document.createElement('script');
gaScript.src = 'https://www.google-analytics.com/analytics.js';
document.head.appendChild(gaScript);
2 changes: 0 additions & 2 deletions src/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ workbox.core.setCacheNameDetails({
// Note: this is populated at build time.
workbox.precaching.precacheAndRoute([]);

workbox.googleAnalytics.initialize({});

workbox.skipWaiting();
Loading