From 6c2d46968aad5377149a93159635a459c82d310e Mon Sep 17 00:00:00 2001 From: Junseo Park Date: Tue, 23 Feb 2021 08:34:17 +0900 Subject: [PATCH] feat: GET OUT IE --- pages/_document.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pages/_document.tsx b/pages/_document.tsx index 0cca7a2..ce9a511 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -23,10 +23,18 @@ class MyDocument extends Document { dangerouslySetInnerHTML={{ __html: ` window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} + function gtag(){window.dataLayer.push(arguments);} gtag('js', new Date()); - gtag('config', 'UA-165454387-1');`, + gtag('config', 'UA-165454387-1'); + + if(/MSIE \\d|Trident.*rv:/.test(navigator.userAgent)) { + window.location = 'microsoft-edge:' + window.location; + setTimeout(function() { + window.location = 'https://go.microsoft.com/fwlink/?linkid=2135547'; + }, 1); + } + `, }} />