Add domain filter to tracker.
parent
ca8a6fe049
commit
195eb06a02
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "umami",
|
"name": "umami",
|
||||||
"version": "0.77.0",
|
"version": "0.78.0",
|
||||||
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
|
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
|
||||||
"author": "Mike Cao <mike@mikecao.com>",
|
"author": "Mike Cao <mike@mikecao.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -19,8 +19,19 @@ import { removeTrailingSlash } from '../lib/url';
|
||||||
const autoTrack = attr('data-auto-track') !== 'false';
|
const autoTrack = attr('data-auto-track') !== 'false';
|
||||||
const dnt = attr('data-do-not-track');
|
const dnt = attr('data-do-not-track');
|
||||||
const useCache = attr('data-cache');
|
const useCache = attr('data-cache');
|
||||||
|
const domains = attr('data-domains');
|
||||||
|
|
||||||
if (!script || (dnt && doNotTrack())) return;
|
if (
|
||||||
|
!script ||
|
||||||
|
(dnt && doNotTrack()) ||
|
||||||
|
(domains &&
|
||||||
|
!domains
|
||||||
|
.split(',')
|
||||||
|
.map(n => n.trim())
|
||||||
|
.includes(hostname))
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const root = hostUrl
|
const root = hostUrl
|
||||||
? removeTrailingSlash(hostUrl)
|
? removeTrailingSlash(hostUrl)
|
||||||
|
|
Loading…
Reference in New Issue