Astro
Add the script to your base layout and you are set - including View Transitions support out of the box.
<head> <script is:inline defer src="https://forge.codeserk.es/cdn/stats.js" data-base-url="https://api-events.forge.codeserk.es" data-sdk="YOUR_SDK_KEY" ></script></head>Two things worth noting:
is:inlineis required. Without it, Astro bundles the script, which breaksdocument.currentScript- and the auto-detection relies on that.deferstill works withis:inline, so you keep the performance benefit.
View Transitions
Section titled “View Transitions”If your site uses View Transitions, the script listens to astro:page-load automatically. Every navigation gets tracked as a page view - nothing else to configure.