Plausible Not Working in Next.js (next-plausible)
Workaround available Web (Next.js) Updated October 21, 2026
Quick answer
next-plausible usually fails because the proxy config doesn't match the provider, the site is statically exported (rewrites don't run), or events are sent from a server component. Match src in PlausibleProvider and withPlausibleProxy and call usePlausible from a client component.
Most likely fix: Match the proxy and provider config.
Symptoms
No pageviews after deploying a Next.js site, proxied /js/script.js returns 404, or custom events from usePlausible never arrive. Some users report breakage after Next.js upgrades.
Why it happens
- Proxy rewrites don't work with static export (they need next start or a platform that runs rewrites)
- withPlausibleProxy config doesn't match PlausibleProvider (v4 requires the same src in both)
- Self-hosted Plausible without customDomain set
- usePlausible called outside a 'use client' component
- Testing on localhost, where tracking is disabled by default
How to fix it
Try these in order — the most common fix is first.
1. Match the proxy and provider config
- Wrap next.config with withPlausibleProxy
- In next-plausible v4, pass the same script src to withPlausibleProxy as to PlausibleProvider
- Rebuild and check that /js/script.js and /api/event load from your domain
2. Don't rely on rewrites with static export
- If you use output: 'export', load the script directly from plausible.io or set up a proxy at your CDN (Cloudflare, Netlify, Vercel)
- Otherwise deploy with next start or Vercel so rewrites run
3. Fix custom events in the App Router
- Move usePlausible calls into a component marked 'use client'
- Make sure PlausibleProvider wraps the layout
- Create a matching goal in Site settings > Goals
4. Self-hosted instance
- Set customDomain to your Plausible CE URL
- Check the Network tab that requests go to your instance
This guide also covers
- next-plausible not working
- plausible nextjs
- plausible next.js app router
- withPlausibleProxy not working
Still not working?
If Plausible Analytics keeps failing, you're not alone. See every Plausible Analytics problem users report or the alternatives people switch to.
Other Plausible Analytics errors
- Plausible Not Tracking Visitors (No Stats Showing)
- Plausible Verification Failed (Couldn't Verify Installation)
- Plausible Blocked by Ad Blockers (How to Set Up a Proxy)
- Plausible Custom Events and Goals Not Showing
- Plausible WordPress Plugin Not Tracking
- Plausible Numbers Different From Google Analytics
- Plausible UTM Parameters and Referrers Not Showing
- Plausible Pageview Limit Exceeded (Dashboard Locked)
- Plausible Google Analytics Import Failed or Missing Data
- How to Exclude Your Own Visits in Plausible
- Self-Hosted Plausible CE Not Recording Pageviews
- Plausible Bot Traffic Spike (Fake Visitors)