-
-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude analytics from
examples
page (#1376)
* fix: exclude analytics from `examples` page leading to page-load-count inception due to code preview examples iframe * chore: isolate fathom-script into client component + fix reliability of the pathname
- Loading branch information
1 parent
7ddef82
commit 2afa3c8
Showing
2 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use client"; | ||
|
||
import { usePathname } from "next/navigation"; | ||
|
||
export function FathomScript() { | ||
const pathname = usePathname(); | ||
const isExamplesPage = pathname.startsWith("/examples/"); | ||
|
||
if (isExamplesPage) return null; | ||
|
||
return <script data-site="UXMSXUQI" defer src="https://cdn.usefathom.com/script.js" />; | ||
} |