Commit 045aea9d authored by isstuev's avatar isstuev

remove bots from monitoring

parent baeedfe4
...@@ -11,6 +11,8 @@ import isNeedProxy from 'lib/api/isNeedProxy'; ...@@ -11,6 +11,8 @@ import isNeedProxy from 'lib/api/isNeedProxy';
import * as cookies from 'lib/cookies'; import * as cookies from 'lib/cookies';
import type * as metadata from 'lib/metadata'; import type * as metadata from 'lib/metadata';
import detectBotRequest from './utils/detectBotRequest';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
const adBannerFeature = config.features.adsBanner; const adBannerFeature = config.features.adsBanner;
...@@ -47,8 +49,9 @@ Promise<GetServerSidePropsResult<Props<Pathname>>> => { ...@@ -47,8 +49,9 @@ Promise<GetServerSidePropsResult<Props<Pathname>>> => {
} }
const isTrackingDisabled = process.env.DISABLE_TRACKING === 'true'; const isTrackingDisabled = process.env.DISABLE_TRACKING === 'true';
const isBot = Boolean(detectBotRequest(req));
if (!isTrackingDisabled) { if (!isTrackingDisabled && !isBot) {
// log pageview // log pageview
const hostname = req.headers.host; const hostname = req.headers.host;
const timestamp = new Date().toISOString(); const timestamp = new Date().toISOString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment