{"repo":"4lejandrito/next-plausible","free":true,"listed":false,"github":"https://github.com/4lejandrito/next-plausible","clone":"git clone https://github.com/4lejandrito/next-plausible.git","description":"Simple integration for https://nextjs.org and https://plausible.io analytics","language":"TypeScript","stars":708,"topics":["nextjs","plausible","plausible-analytics"],"license":"MIT","category":"analytics","readme_excerpt":"Next-Plausible &middot; Simple integration for https://nextjs.org and https://plausible.io analytics. See it in action at https://next-plausible.vercel.app, and this commit for a real world example. Important: If you're using a version of next lower than 11.1.0 please use next-plausible@2 to avoid type checking errors (see https://github.com/4lejandrito/next-plausible/issues/25). Upgrading from v3? See the migration guide. Usage Include the Analytics Script To enable Plausible analytics in your Next.js app you'll need to expose the Plausible context, , at the top level of your application inside app.js . First, find your site-specific script URL in your Plausible dashboard (it looks like https://plausible.io/js/pa-XXXXX.js ). If you want to enable Plausible analytics only on a single page you can wrap the page in a PlausibleProvider component: If you are using the app directory use PlausibleProvider inside the root layout: PlausibleProvider Props Name Description ------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- src The site-specific script URL from your Plausible dashboard, e.g. https://plausible.io/js/pa-XXXXX.js . Not required when using withPlausibleProxy . init Options passed to plausible.init() . See below for available options. enabled Use this to explicitly decide whether or not to render script. If not passed the script will be rendered ","default_branch":null,"files":null,"tree":[],"storefront":"/r/4lejandrito","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/4lejandrito/next-plausible/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}