Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlausibleProvider with Next js 13.4.12 #103

Open
4lejandrito opened this issue Oct 8, 2023 Discussed in #100 · 2 comments
Open

PlausibleProvider with Next js 13.4.12 #103

4lejandrito opened this issue Oct 8, 2023 Discussed in #100 · 2 comments

Comments

@4lejandrito
Copy link
Owner

Discussed in #100

Originally posted by jamezening August 12, 2023
I am having difficulty getting PlausibleProvider to work with Next js 13.4.12.
As shown in the documentation I have added the provider in

app/layout.tsx

    <html lang="en">
      <head>
        <PlausibleProvider domain={mydomain} trackLocalhost />
      </head>
      <body className={inter.className}>
        <Providers>
          <section className="flex justify-center">{children}</section>
        </Providers>
      </body>
    </html>

I am not getting any event from local host or when deployed.

Any tips would be appreciated.

@jedwards1230
Copy link

Do you have any extensions that may be blocking the request to Plausible? I think UBlock Origin (or something similar) was blocking my plausible requests from resolving.

If this is the issue, you can unblock your domain, or you can check out the plausible proxy in this repo. The proxy redirects the request back to your server, then off to plausible. This way it looks like a normal transaction with your site instead of tracking.

@Peracek
Copy link

Peracek commented Feb 29, 2024

@4lejandrito any chance you have badly set NODE_ENV variable? This is the condition for the tracking being enabled.

enabled = process.env.NODE_ENV === 'production' &&
      (!process.env.NEXT_PUBLIC_VERCEL_ENV ||
        process.env.NEXT_PUBLIC_VERCEL_ENV === 'production')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants