Add plausible tracking to wallpaper download events

This commit is contained in:
Chuck Dries 2022-03-22 12:48:10 -07:00
parent c0c8d66b2c
commit cdbf2bfc56
No known key found for this signature in database
GPG Key ID: A00B7AEAE1DC5BE6

View File

@ -162,6 +162,13 @@ const GalleryImage = ({ data, pageContext }) => {
className="inline-block bg-muted-light text-vibrant-dark underline font-serif p-1 my-1 rounded" className="inline-block bg-muted-light text-vibrant-dark underline font-serif p-1 my-1 rounded"
download download
href={image.publicURL} href={image.publicURL}
onClick={() => {
try {
window.plausible("Download Wallpaper", { props: { image: image.base } });
} catch {
// do nothing
}
}}
> >
Download wallpaper Download wallpaper
</a> </a>