Skip to content

Commit

Permalink
Add very minimal analytics
Browse files Browse the repository at this point in the history
- Use Plausible for analytics (GDPR compliant, no cookies)
- Integrate analytics with partytown
  (https://juri.dev/notes/astro-partytown-plausible/)
  • Loading branch information
Einlar committed May 24, 2024
1 parent fac02c5 commit b00962e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
3 changes: 3 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import remarkCollapse from "remark-collapse";
import sitemap from "@astrojs/sitemap";
import { SITE } from "./src/config";

import partytown from "@astrojs/partytown";

// https://astro.build/config
export default defineConfig({
site: SITE.website,
Expand All @@ -15,6 +17,7 @@ export default defineConfig({
}),
react(),
sitemap(),
partytown(),
],
markdown: {
remarkPlugins: [
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"dependencies": {
"@astrojs/check": "^0.6.0",
"@astrojs/partytown": "^2.1.0",
"@astrojs/rss": "^4.0.2",
"@resvg/resvg-js": "^2.6.0",
"astro": "^4.2.1",
Expand Down Expand Up @@ -61,4 +62,4 @@
"prettier --write --plugin=prettier-plugin-astro"
]
}
}
}
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ const socialImageURL = new URL(
<ViewTransitions />

<script is:inline src="/toggle-theme.js"></script>

<script
type="text/partytown"
async
data-domain="goldshish.it"
src="https://plausible.kiwi.amogus.it/js/script.js"></script>
</head>
<body>
<slot />
Expand Down

0 comments on commit b00962e

Please sign in to comment.