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

Drop Google analytics? #3

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
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
33 changes: 0 additions & 33 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,4 @@
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
<script>
if (ANALYTICS && typeof window !== 'undefined') {
// copy-paste from Google Analytics
function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
(i[r] =
i[r] ||
function () {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
}
)(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-44428446-1', 'washington.edu');
}

function track() {
if (window.ga) {
// replace this with modern web
// var url = Backbone.history.getFragment();
var url = window.location.pathname + window.location.search;

// Add slashes if needed
if (!/^\//.test(url)) url = '/' + url;
if (!/\/$/.test(url)) url += '/';
ga('send', { hitType: 'pageview', page: url });
}
}
</script>
</html>
Loading