next-google-analytics 4.0.2
Install from the command line:
Learn more about npm packages
$ npm install @eisberg-labs/next-google-analytics@4.0.2
Install via package.json:
"@eisberg-labs/next-google-analytics": "4.0.2"
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
- over 2 years ago
- MIT
- 6 dependencies
Assets
- next-google-analytics-4.0.2.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0