diff --git a/package.json b/package.json index 0d602350..c21f3076 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "0.77.0", + "version": "0.78.0", "description": "A simple, fast, website analytics alternative to Google Analytics. ", "author": "Mike Cao ", "license": "MIT", diff --git a/tracker/index.js b/tracker/index.js index 154e0034..df4c5216 100644 --- a/tracker/index.js +++ b/tracker/index.js @@ -19,8 +19,19 @@ import { removeTrailingSlash } from '../lib/url'; const autoTrack = attr('data-auto-track') !== 'false'; const dnt = attr('data-do-not-track'); 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 ? removeTrailingSlash(hostUrl)