Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

joshuabaker/next-fathom

Repository files navigation

Next Fathom

Next Fathom

Next Fathom is a component wrapper around fathom-client that allows you to quickly and easily add Fathom Analytics to your Next.js projects that use the App Router.

Installation

To install the package using npm, run the following command in your terminal:

npm install next-fathom

Alternatively, if you are using yarn, use the following command:

yarn add next-fathom

Usage

In your layout, import and add the Fathom component, and add your Site ID to the siteId prop. This will load the Fathom client and track page views automatically.

import { Fathom } from "next-fathom";
export default function RootLayout({ children }) {
 return (
 <html lang="en">
 <body>
 <Fathom
 siteId={"MY_FATHOM_ID"}
 options={{ includedDomains: ["example.com"] }}
 />
 {children}
 </body>
 </html>
 );
}

Other methods

This package also re-exports everything from the fathom-client package (e.g. trackGoal). See the fathom-client readme for how to use these.

Referrals

If you’ve not yet signed up you can use my referral link to get 10ドル credit.

Get 10ドル credit for Fathom Analytics

About

πŸ“ˆ Add Fathom tracking to Next.js projects that use the App Router.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /