From 27cabcf6e5eb75bd0fff1eb556ee44d597ae792d Mon Sep 17 00:00:00 2001
From: Rui Saraiva
Date: Sat, 27 Jun 2020 22:10:42 +0100
Subject: [PATCH] feat(analytics): add google analytics with anonymized ip
(#150)
---
pages/_document.tsx | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/pages/_document.tsx b/pages/_document.tsx
index 9b9cfa8..8982e39 100644
--- a/pages/_document.tsx
+++ b/pages/_document.tsx
@@ -1,11 +1,29 @@
import React from 'react'
import Document, { Html, Head, Main, NextScript } from 'next/document'
+const isProd = process.env.NODE_ENV === 'production'
+
class MyDocument extends Document {
render() {
return (
-
+
+ {isProd && }
+ {isProd && (
+
+ `,
+ }}
+ />
+ )}
+