next-google-analytics 1.1.1
Install from the command line:
Learn more about npm packages
$ npm install @eisberg-labs/next-google-analytics@1.1.1
Install via package.json:
"@eisberg-labs/next-google-analytics": "1.1.1"
About this version
NextJS React Component for Google universal analytics.
npm i --save @eisberg-labs/next-google-analytics
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} />
</>
);
}
MIT © Eisberg Labs
Details
- next-google-analytics
-
eisberg-labs
- about 2 years ago
- MIT
- 6 dependencies
Assets
- next-google-analytics-1.1.1.tgz
Download activity
- Total downloads 1
- Last 30 days 0
- Last week 0
- Today 0