next-fathom
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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"} />
        {children}
      </body>
    </html>
  );
}

Other methods

This package also re-exports everything from the fathom-client package ( e.g. trackPageview, trackGoal, etc.). 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

Readme

Keywords

none

Package Sidebar

Install

npm i next-fathom

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

7.01 kB

Total Files

9

Last publish

Collaborators

  • joshuabaker