✨ Switched to plausible-tracker and removed node-fetch
This commit is contained in:
@@ -18,8 +18,23 @@
|
||||
import { initLocalizationContext } from '$lib/i18n';
|
||||
import { browser } from '$app/env';
|
||||
import Alert from '$lib/modals/alert.svelte';
|
||||
import { plausible } from '$lib/stores';
|
||||
|
||||
/* afterNavigate(() => {
|
||||
if (browser) {
|
||||
if (latestPageVisitURl === window.location.href) {
|
||||
return;
|
||||
} else {
|
||||
latestPageVisitURl = window.location.href;
|
||||
plausible.trackPageview();
|
||||
}
|
||||
console.log('After nav');
|
||||
}
|
||||
});*/
|
||||
|
||||
if (browser) {
|
||||
plausible.enableAutoPageviews();
|
||||
plausible.enableAutoOutboundTracking();
|
||||
pathname.set(window.location.pathname);
|
||||
if (
|
||||
localStorage.theme === 'dark' ||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import { DateTime } from 'luxon';
|
||||
import { getLocalization } from '$lib/i18n';
|
||||
import Footer from '$lib/footer.svelte';
|
||||
import { alertModal, navbarVisible, signedIn } from '$lib/stores';
|
||||
import { alertModal, navbarVisible, signedIn, plausible } from '$lib/stores';
|
||||
|
||||
interface QuizData {
|
||||
id: string;
|
||||
@@ -71,7 +71,7 @@
|
||||
}
|
||||
const data = await res.json();
|
||||
// eslint-disable-next-line no-undef
|
||||
plausible('Started Game', { props: { quiz_id: id } });
|
||||
plausible.trackEvent('Started Game', { props: { quiz_id: id } });
|
||||
window.location.replace(`/admin?token=${data.game_id}&pin=${data.game_pin}&connect=1`);
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
import ShowTitle from '$lib/play/title.svelte';
|
||||
import Question from '$lib/play/question.svelte';
|
||||
import ShowResults from '$lib/play/show_results.svelte';
|
||||
import { navbarVisible } from '$lib/stores';
|
||||
import { navbarVisible, plausible } from '$lib/stores';
|
||||
import ShowEndScreen from '$lib/play/end.svelte';
|
||||
|
||||
// Exports
|
||||
@@ -66,7 +66,7 @@
|
||||
console.log('joined_game', data);
|
||||
gameData = JSON.parse(data);
|
||||
// eslint-disable-next-line no-undef
|
||||
plausible('Joined Game', { props: { quiz_id: gameData.quiz_id } });
|
||||
plausible.trackEvent('Joined Game', { props: { quiz_id: gameData.quiz_id } });
|
||||
});
|
||||
|
||||
socket.on('game_not_found', () => {
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
import { createTippy } from 'svelte-tippy';
|
||||
import 'tippy.js/animations/perspective-subtle.css';
|
||||
import 'tippy.js/dist/tippy.css';
|
||||
import { plausible } from '$lib/stores';
|
||||
|
||||
const tippy = createTippy({
|
||||
arrow: true,
|
||||
@@ -79,7 +80,7 @@
|
||||
}
|
||||
const data = await res.json();
|
||||
// eslint-disable-next-line no-undef
|
||||
plausible('Started Game', { props: { quiz_id: id } });
|
||||
plausible.trackEvent('Started Game', { props: { quiz_id: id } });
|
||||
window.location.replace(`/admin?token=${data.game_id}&pin=${data.game_pin}&connect=1`);
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user