Update analytics script source in app.html and add new stats page with Plausible Analytics integration. The new page features a dashboard for public analytics, enhancing user engagement and data visibility.

This commit is contained in:
Luke Hagar
2025-08-29 16:00:14 -05:00
parent 0523bbe6cc
commit 5550e9b4ba
2 changed files with 28 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<script defer data-domain="pypistats.dev" src="https://events.plygrnd.org/js/script.js"></script> <script defer data-domain="pypistats.dev" src="https://events.plygrnd.org/js/script.outbound-links.pageview-props.tagged-events.js"></script>
%sveltekit.head% %sveltekit.head%
</head> </head>
<body data-sveltekit-preload-data="hover"> <body data-sveltekit-preload-data="hover">

View File

@@ -0,0 +1,27 @@
<script lang="ts">
import { MetaTags } from 'svelte-meta-tags';
</script>
<MetaTags
title="Site Analytics - PyPI Stats"
description="Public analytics for PyPIStats.dev powered by Plausible Analytics."
keywords={["PyPIStats", "analytics", "Plausible", "traffic stats"]}
/>
<svelte:head>
<script async src="https://events.plygrnd.org/js/embed.host.js"></script>
</svelte:head>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div class="mb-8 text-center">
<h1 class="text-3xl font-bold text-gray-100">Site Analytics</h1>
<p class="text-gray-400 mt-2">Public dashboard powered by Plausible</p>
</div>
<div class="rounded-lg border border-gray-800 bg-gray-900 p-4">
<iframe title="Plausible Analytics for pypistats.dev" data-plausible-embed src="https://events.plygrnd.org/share/pypistats.dev?auth=cT6JcGh_NFK5biIvXyKi1&embed=true&theme=system&background=transparent" scrolling="no" frameborder="0" loading="lazy" style="width: 1px; min-width: 100%; height: 1600px;"></iframe>
<div class="text-sm text-gray-400 pt-3 pb-1">Stats powered by <a target="_blank" class="text-indigo-400 underline" href="https://plausible.io">Plausible Analytics</a></div>
</div>
</div>