4lejandrito / next-plausible

Simple integration for https://nextjs.org and https://plausible.io analytics
https://next-plausible.vercel.app
MIT License
603 stars 33 forks source link

Add `usePlausibleEvent` #73

Closed johanneskares closed 1 year ago

johanneskares commented 2 years ago

Hi there,

would be great to have a small additional hook that fires an event on the component mount. I tried implementing it, but I got stuck creating the right templates; they don't work properly. Maybe you have a clue.

https://github.com/4lejandrito/next-plausible/pull/72

Johannes

4lejandrito commented 2 years ago

Hi @johanneskares! Thanks for this. However I prefer to keep the API surface as reduced as possible to avoid maintenance.

Is this something that you have to do in many components?

4lejandrito commented 1 year ago

Closing this for now, please reopen if necessary.