Add plausible
This commit is contained in:
parent
a6ec5b9e55
commit
eb807a63a6
7 changed files with 61 additions and 19 deletions
|
|
@ -4,12 +4,7 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Fizika Admin - Kérdések és képek kezelése</title>
|
<title>Fizika Admin - Kérdések és képek kezelése</title>
|
||||||
<script
|
<script type="module" src="stats.js"></script>
|
||||||
defer
|
|
||||||
data-domain="fizika.schmelczer.dev"
|
|
||||||
data-api="https://stats.schmelczer.dev/status"
|
|
||||||
src="https://stats.schmelczer.dev/js/script.file-downloads.hash.outbound-links.js"
|
|
||||||
></script>
|
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
||||||
12
backend/public/stats.js
Normal file
12
backend/public/stats.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { init } from "/vendor/plausible.js";
|
||||||
|
|
||||||
|
// Plausible analytics via the official npm tracker (@plausible-analytics/tracker).
|
||||||
|
// server.js serves /vendor/plausible.js straight from node_modules.
|
||||||
|
init({
|
||||||
|
domain: "fizika.schmelczer.dev",
|
||||||
|
endpoint: "https://stats.schmelczer.dev/status",
|
||||||
|
autoCapturePageviews: true,
|
||||||
|
outboundLinks: true,
|
||||||
|
fileDownloads: true,
|
||||||
|
hashBasedRouting: true,
|
||||||
|
});
|
||||||
|
|
@ -56,19 +56,7 @@
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/load.js"></script>
|
<script src="js/load.js"></script>
|
||||||
<script src="js/fizika.js"></script>
|
<script src="js/fizika.js"></script>
|
||||||
<script
|
<script type="module" src="js/stat.js"></script>
|
||||||
defer
|
|
||||||
data-domain="fizika.schmelczer.dev"
|
|
||||||
data-api="https://stats.schmelczer.dev/status"
|
|
||||||
src="https://stats.schmelczer.dev/js/script.file-downloads.hash.outbound-links.js"
|
|
||||||
></script>
|
|
||||||
<script>
|
|
||||||
window.plausible =
|
|
||||||
window.plausible ||
|
|
||||||
function () {
|
|
||||||
(window.plausible.q = window.plausible.q || []).push(arguments);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body onresize="aspect()">
|
<body onresize="aspect()">
|
||||||
<div id="titlebox">
|
<div id="titlebox">
|
||||||
|
|
|
||||||
2
frontend/js/plausible.js
Normal file
2
frontend/js/plausible.js
Normal file
File diff suppressed because one or more lines are too long
10
frontend/js/stats.js
Normal file
10
frontend/js/stats.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import { init } from "./plausible.js";
|
||||||
|
|
||||||
|
init({
|
||||||
|
domain: "fizika.schmelczer.dev",
|
||||||
|
endpoint: "https://stats.schmelczer.dev/status",
|
||||||
|
autoCapturePageviews: true,
|
||||||
|
outboundLinks: true,
|
||||||
|
fileDownloads: true,
|
||||||
|
hashBasedRouting: true,
|
||||||
|
});
|
||||||
22
frontend/package-lock.json
generated
Normal file
22
frontend/package-lock.json
generated
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"name": "fizika-frontend",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "fizika-frontend",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@plausible-analytics/tracker": "^0.4.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@plausible-analytics/tracker": {
|
||||||
|
"version": "0.4.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@plausible-analytics/tracker/-/tracker-0.4.5.tgz",
|
||||||
|
"integrity": "sha512-6BfAGejXY+YA3Cw6LYT2Zpn4hTxDtPQAawFsYUsQCOg78wIS5C4deAGXTfJffa5VleMWITv5lpJ/EYuQBl1tPA==",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
frontend/package.json
Normal file
13
frontend/package.json
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"name": "fizika-frontend",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Static frontend for the Fizika practice app",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"vendor": "cp node_modules/@plausible-analytics/tracker/plausible.js js/plausible.js",
|
||||||
|
"postinstall": "npm run vendor"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@plausible-analytics/tracker": "^0.4.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue