eisberg labs logo
Eisberg Labs React Components
About UsBlog

Downloads

Next Google Analytics

NextJS React Component for Google universal analytics.

Installation

npm i --save @eisberg-labs/next-google-analytics

Usage

Add this on your page, I'd recommend a pages/_app.tsx for global access.


export default function MyApp({Component, pageProps}) {
  return (
    <>
      {process.env.NEXT_PUBLIC_ANALYTICS_ID && <GoogleAnalytics ga_id={process.env.NEXT_PUBLIC_ANALYTICS_ID}/>}
      <Component {...pageProps} />
    </>
  );
}

License

MIT © Eisberg Labs

Examples

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

4.0.2 (2023-01-25)

Note: Version bump only for package @eisberg-labs/next-google-analytics

4.0.0 (2023-01-25)

Note: Version bump only for package @eisberg-labs/next-google-analytics

3.1.0 (2023-01-03)

Note: Version bump only for package @eisberg-labs/next-google-analytics

3.0.1 (2023-01-02)

Bug Fixes

3.0.0 (2022-12-27)

Bug Fixes

Features