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

Enabling only for vercel production deployments #46

Closed 4lejandrito closed 2 years ago

4lejandrito commented 2 years ago

Using NEXT_PUBLIC_VERCEL_ENV as described in:

https://vercel.com/docs/concepts/projects/environment-variables

JamesSingleton commented 2 years ago

@4lejandrito have you tried tested this in an actual deployment? It looks good to me.

4lejandrito commented 2 years ago

@4lejandrito have you tried tested this in an actual deployment? It looks good to me.

I've modified the tests so that they run on vercel and they work like a charm. You can see it for yourself too:

Preview deployment: https://vercel-next-plausible.vercel.app. (No tracking). Production deployment: https://next-plausible.vercel.app. (Tracking).

I'll publish these changes soon.

Thanks!