Instrumented custom plausible event to track station plays.

This commit is contained in:
Luke Bunselmeyer 2023-05-08 18:20:17 -04:00
parent 1609349a8b
commit ae542cca8b
2 changed files with 4 additions and 2 deletions

View File

@ -37,7 +37,8 @@ export function StationsGallery({ stations, tag }: StationsGalleryProps) {
</h2>
<p>{station.description}</p>
<div className="card-actions justify-end">
<Link to={getStationUrl(station.id)} className="btn btn-primary gap-2">
<Link to={getStationUrl(station.id)}
className={`btn btn-primary gap-2 plausible-event-name=play-station plausible-event-station=${station.slug}`}>
<PlayIcon className="h-6 w-6" />
Listen Now
</Link>

View File

@ -35,7 +35,8 @@ export function Document({ title, children }: DocumentProps) {
{title ? <title>{title}</title> : null}
<Meta />
<Links />
<script defer data-domain="awesome-radio-1ae3.fly.dev" src="https://plausible.io/js/script.js"></script>
<script defer data-domain="awesome-radio-1ae3.fly.dev"
src="https://plausible.io/js/script.tagged-events.js"></script>
</head>
<body className="h-full">
{children}