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

Unique count with Next.js 14 and proxy #121

Closed maximedeoliveira closed 6 months ago

maximedeoliveira commented 6 months ago

Every time I hit refresh on a page, plausible count it as new visitor. Do I need to configure something else, to make unique count works as expected ?

Screenshot 2024-05-15 at 13 26 45

next.config.mjs

import {withPlausibleProxy} from "next-plausible";

/** @type {import('next').NextConfig} */
const nextConfig = {};

export default withPlausibleProxy({customDomain: 'https://analytics.****.fr',})(nextConfig);

app/layout.tsx

<html lang="fr">
  <head>
    <PlausibleProvider domain="gpro.app" selfHosted={true} enabled={true}  />
  </head>
</html>

package.json

"next": "14.1.0",
"next-plausible": "^3.12.0"
4lejandrito commented 6 months ago

There is nothing else to configure. I would recommend you to read how plausible counts single visits and check if everything makes sense to you and your setup.