Skip to content

next-google-analytics 3.1.0

Install from the command line:
Learn more about npm packages
$ npm install @eisberg-labs/next-google-analytics@3.1.0
Install via package.json:
"@eisberg-labs/next-google-analytics": "3.1.0"

About this version

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

Details


Assets

  • next-google-analytics-3.1.0.tgz

Download activity

  • Total downloads 312
  • Last 30 days 0
  • Last week 0
  • Today 0