-
Notifications
You must be signed in to change notification settings - Fork 18
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
Nextjs 13 App Dir example triggers twice on initial site load #45
Comments
Maybe related? vercel/next.js#49115 |
Sorry for the trouble! This might be worth a shot. I suspect it's auto-firing a page view on load, and then firing another pageview in the other effect hook. function TrackPageView() {
const pathname = usePathname()
const searchParams = useSearchParams()
useEffect(() => {
load('MY_FATHOM_ID', {
includedDomains: ['yourwebsite.com'],
+ auto: false
})
}, []) Let me know if this solves it and we can update the docs! |
Ah, yes that does appear to work. Thanks! |
Cool! I'll update the readme. |
It didn't work for me |
@shhgholipour do you have a Next.js repo you can point to that reproduces the issue? |
Just followed the guide on installing fathom using the App directory with Nextjs 13 and I noticed the
trackPageview()
runs twice on the initial site load. Basically, any initial visit or page refresh.next: 13.4.2
Here's a repro: https://codesandbox.io/p/sandbox/inspiring-raman-yxnjxp
The text was updated successfully, but these errors were encountered: