2.3.4 • Published 5 years ago

next-ga v2.3.4

Weekly downloads
3,016
License
MIT
Repository
github
Last release
5 years ago

next-ga

Next.js High Order Component to integrate Google Analytics on every page change.

Usage

Install it

yarn add next-ga

Import it inside your pages/_app.js;

import Router from "next/router";
import withGA from "next-ga";

Wrap your custom App container with it

// pass your GA code as first argument
export default withGA("UA-xxxxxxxxx-1", Router)(MyApp);

That's it, now when the user access a page it will log a pageview to Google Analytics, each page change after that will also trigger a pageview on Google Analytics.

Note: This module detects if it's running in localhost and do nothing there to avoid polluting your analytics with local data.

2.3.4

5 years ago

2.3.3

5 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago