diff --git a/components/site/feedback.tsx b/components/site/feedback.tsx index e12243630..6d0ac716a 100644 --- a/components/site/feedback.tsx +++ b/components/site/feedback.tsx @@ -3,7 +3,7 @@ import { Box, Button, Modal, useModal, Radio, TextField } from '@sparkpost/match import { useRouter } from 'next/router'; import { v4 as uuid } from 'uuid'; import { AlertsContext } from 'context/alerts'; -import { track } from 'utils/segment'; +import { track } from 'utils/rudderstack'; const reasonList = [ { diff --git a/components/site/rudderstack.tsx b/components/site/rudderstack.tsx new file mode 100644 index 000000000..9e9cf967c --- /dev/null +++ b/components/site/rudderstack.tsx @@ -0,0 +1,37 @@ +import Script from 'next/script'; +import isbot from 'isbot'; +import { getWindow } from 'utils/ssr'; + +const RudderStack = (): JSX.Element => { + const isBotSSR = (): boolean => { + let bot = false; + if (getWindow()) { + bot = isbot(window.navigator.userAgent); + } + + return bot; + }; + + return ( + <> + {process.env.NODE_ENV === 'production' && !isBotSSR() && ( +