added tracking snippet with env variable
This commit is contained in:
+7
-1
@@ -1,5 +1,6 @@
|
||||
import Document, { Html, Head, Main, NextScript } from "next/document";
|
||||
import SkipLink from "../components/skiplink";
|
||||
import { Tracking, TrackingNoScript } from "../components/tracking";
|
||||
//import basicAuthMiddleware from "nextjs-basic-auth-middleware";
|
||||
|
||||
class MyDocument extends Document {
|
||||
@@ -19,10 +20,15 @@ class MyDocument extends Document {
|
||||
// }
|
||||
|
||||
render() {
|
||||
const googleTagManagerID = process.env.GOOGLE_TAG_MANAGER || null;
|
||||
|
||||
return (
|
||||
<Html lang="en">
|
||||
<Head />
|
||||
<Head>
|
||||
<Tracking googleTagManagerID={googleTagManagerID} />
|
||||
</Head>
|
||||
<body className="js-enabled">
|
||||
<TrackingNoScript googleTagManagerID={googleTagManagerID} />
|
||||
{!process.browser && (
|
||||
<script>
|
||||
window.apiRoot = `{process.env.API_ROOT}`
|
||||
|
||||
Reference in New Issue
Block a user