Added check to disable tracking.

This commit is contained in:
Mike Cao 2020-11-01 22:01:30 -08:00
parent b116fbf4cb
commit e0c2354169
3 changed files with 68 additions and 61 deletions

View file

@ -6,6 +6,7 @@ import { removeTrailingSlash } from '../lib/url';
screen: { width, height },
navigator: { language },
location: { hostname, pathname, search },
localStorage,
sessionStorage,
document,
history,
@ -24,6 +25,7 @@ import { removeTrailingSlash } from '../lib/url';
const domains = attr('data-domains');
const disableTracking =
localStorage.getItem('umami.disabled') ||
(dnt && doNotTrack()) ||
(domains &&
!domains