Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Ignore visits based on hostname #1151

Closed
patrickhilker opened this issue May 14, 2022 · 13 comments
Closed

[Feature Request] Ignore visits based on hostname #1151

patrickhilker opened this issue May 14, 2022 · 13 comments
Labels
enhancement New feature or request fixed in dev Fixed in the dev branch

Comments

@patrickhilker
Copy link

I use a DynDNS pointing to my IP at home. By resolving this hostname Umami could get my IP and ignore my visits.

Would such a feature be appreciated? I would be able to contribute the code.

@patrickhilker patrickhilker changed the title Feature Request: Ignore visits based on hostname [Feature Request] Ignore visits based on hostname May 14, 2022
@mikecao
Copy link
Collaborator

mikecao commented May 16, 2022

You just need to add umami.disabled = true to local storage and your visits will be ignored.

@patrickhilker
Copy link
Author

As far as I know this has to be done for every website, on every client, hasn't it? For everyone tracking a few websites this becomes pretty quick a huge task. On mobile devices this is not even possible (at least in Chrome on Android).

Tracking 30 websites and working from 3 clients I personally have to edit my local storage 90 times. If one is an agency with employees this becomes absolutely unmaintainable.

@mikecao
Copy link
Collaborator

mikecao commented May 16, 2022

You can use the IGNORE_IP environment variable then. See https://umami.is/docs/environment-variables

@patrickhilker
Copy link
Author

As I get a new IP every day this is not really an alternative

@mikecao
Copy link
Collaborator

mikecao commented May 18, 2022

Ok, we can prob add a new environment variable then.

@mikecao mikecao added the enhancement New feature or request label May 18, 2022
@rohandebsarkar
Copy link
Contributor

This will be helpful.

@mikecao
Copy link
Collaborator

mikecao commented May 19, 2022

Just keep in mind that this could potentially be very slow. You are effectively running a DNS lookup for every pageview.

@rohandebsarkar
Copy link
Contributor

rohandebsarkar commented May 19, 2022

Sorry, probably I understood the issue wrong.

I meant to ignore visits based on hostnames, like while testing my website locally, if the visits are coming from localhost or 127.0.0.1.

Sorry for misunderstanding. Shall I open a different issue for that?

@mikecao
Copy link
Collaborator

mikecao commented May 19, 2022

@rohandebsarkar You can use the existing variables to do that, https://umami.is/docs/environment-variables

@rohandebsarkar
Copy link
Contributor

Thank you for replying. Are you talking about the hostname variable? There is no documentation below it.

@mikecao
Copy link
Collaborator

mikecao commented May 19, 2022

No just the IGNORE_IP, just enter your localhost IP

@rohandebsarkar
Copy link
Contributor

No just the IGNORE_IP, just enter your localhost IP

I tried IGNORE_IP. But it didn't work.
But I was able to get it to work with data-domains attribute.

@mikecao mikecao added the fixed in dev Fixed in the dev branch label Jun 27, 2022
ayewo added a commit to ayewo/umami that referenced this issue Sep 4, 2022
* Update fr-FR.json

* New mobile menu.

* Fix realtime metrics header for mobile. Closes umami-software#959.

* Added language and theme settings.

* Mobile layout updates.

* Add link to realtime referrers.

* Fix refresh button. Closes umami-software#994, umami-software#985.

* Fix default date range setting.

* Added website limit and show more button. Closes umami-software#592.

* Fix tracker build.

* Updated packages.

* Updated react-spring to latest.

* Bump version 1.27.0.

* Updated language files.

* Fix check-lang script. Ignore all en-GB.

* Missing translations added

* Proofreading

* Fix update notice styling.

* New Dashboard component.

* Updated language files.

* Use beacon api for links. Closes umami-software#446.

* Fix CSS in header.

* Updated CORS options.

* Fix issue with sendBeacon request.

* Updated collect API response.

* Added css-events tracker parameter. Closes umami-software#1018.

* Mobile css updates.

* Updated packages.

* Check for empty content-type header.

* Fix eslint plugin issue.

* Update session hash calculation.

* Fix issue with force SSL redirects.

* Added telemetry script.

* Updated telemetry payload.

* Added postbuild script.

* 404 page should use local url. Closes umami-software#1028

* Added Docker updating notes

* Filter subdomains in referrers regex test. Closes umami-software#632

* Update events chart when filter selected. Closes umami-software#494

* Update packages. Bump version v1.28.0

* Update pl-PL.json

* Cleaned up eslint config.

* Fixed XML error in Firefox. Renamed telemetry env var.

* Refactored localization files.

* Set content type for responses.

* Updated telemetry payload.

* Fix 500 error in response.

* Added prestart script.

* Enabling caching in tracker script.

* Added action to telemetry payload.

* Fix upgrade logic.

* Added previous version to payload.

* support multiple track script name

* Rename ref to prevent collision with react elements

It seems that, at least in dev mode, 'ref' may incorrectly refer to
react elements.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>

* Fix referrer filter

7530de8 introduced a regression: the
domain parameter in refFilter() contains 'https://', which bypass the
new regex; thus we readd the call to getDomainName().

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>

* Update metric tables when filtering on referrer

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>

* feat(docker): use github.ref_name variable for image name

* feat(ci): add ci action

* feat(ci): use matrix build to target databases

* feat(cd): use semantic release for docker images

* Update zh-CN.json

* fixup! Rename ref to prevent collision with react elements

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>

* fixup! Update metric tables when filtering on referrer

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>

* Update zh-CN.json

* Update fr-FR.json

translated the right file this time

* fix active users not appear

* build(deps): bump minimist from 1.2.5 to 1.2.6

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updated packages.

* Update prisma seed files.

* Updated packages. Use React 18.

* Updated next and prisma.

* Use yarn for docker build.

* Update language bundles.

* Add missing translations and fix spelling errors

* Allow user to change admin username.

* Bump version v1.29.0.

* Added CORS to website API endpoints.

* Update node version

* Update dependencies.

* Fix for docker build.

* preserve dashboard settings in localStorage

* Updated start scripts.

* Ignore errors from telemetry.

* Updated es-MX language file.

* Changed force SSL method to send headers.

* Re-use the response from forceSSL.

* fix: unable to sort by referrer

* fix: further address issue in umami-software#1043

* fix: forgot to include referrer filter in sessionMetrics

* Update readme.

* Remove prestart script.

* Preload image.

* Updated packages.

* Check for no session. Closes umami-software#1075

* Include version for preload.

* Update zh-TW.json

* Update zh-CN.json

* Refactor multi-script name code. Update languages.

* Allow filtering on session fields.

* Updated filter processing logic.

* Fix active users.

* Updated packages.

* build(deps): bump minimist from 1.2.5 to 1.2.6

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Translated missing string
Theme, does not to be translated

* Updated hash method.

* Updated language bundles.

* Updated de-DE.

* Allow filtering of events with url.

* Updated Next.

* fix filter link

* remove decodeURI

* Updated it-IT.json

* update ru-RU locale

* Updated packages. Updated language bundles.

* Changed hash method again.

* fix: cover edge case of script name

* Updated language bundle.

* Reverted Next to v12.1.0 due to Heroku issues.

* Updated share token logic. Closes umami-software#1113.

* Updated README.

* Bump version 1.31.0.

* fix(readme): replace npm install by yarn install

* Update `tracker/index.js`: `SendBeacon()` to Fetch API

* use outputStandalone to reduce docker image size

* Updated yarn references in README.

* Update spelling from useLoadiing to useLoading

* Update de-DE.json

Corrected a few translations

* Updated Prisma to v3.14.

* Fix missing Dashboard translation

* Updated packages.

* Updated language bundle.

* Updated version check.

* Bump version 1.32.0.

* Revert postcss package.

* Update disable login message.

* Added missing args.

* Update github action.

* Revert github action change.

* Run migrations on start

* undo change to deps

* Update lang/fa-IR.json

* Updated mn-MN.json

* Improve pt-BR translations

* Updated docker file.

* Updated language bundles.

* Updated language bundles.

* Update vi-VN.json

* Refactor migrations.

* Added database check.

* Remove check-db from build step.

* Added logging to test Vercel issue.

* Removed DISABLE_LOGIN from middleware.

* Remove prisma dir before copying files.

* Updated build order.

* Removed HASH_SALT requirement.

* Updated to prisma 3.15.2. Updated check-db script.

* Added SQL files for docker-compose.

* Fix display of encoded characters. Closes umami-software#1171.

* Updated version checking.

* Remove console.log.

* Switch to manual workflow.

* Removed default latest tag.

* Add option to include latest tag.

* Update fr-FR.json

* Added Galacian language.

* Updated download scripts.

* Removed password from accounts query. Closes umami-software#1153.

* Added IGNORE_HOSTNAME environment variable. Closes umami-software#1151.

* Update deploy github action.

* Updated luanguage bundles.

* Version bump v1.33.

* Fixed README. Remove Railway mention.

* Update vi-VN.json

* match init and postgres prisma schema

* Update docker build.

* Updated mysql migration file.

* Renamed init folder.

* Fix mysql schema.

* update mysql schema and init migration file

* Updated language bundle.

* Removed bad migration file.

* Add latest tag to manual build.

* Updated migration process.

* Bump version v1.31.1.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jerem Dlcn <44464165+JeremDlcn@users.noreply.github.com>
Co-authored-by: Mike Cao <mike@mikecao.com>
Co-authored-by: Mike Cao <moocao@gmail.com>
Co-authored-by: Klooven <Klooven@users.noreply.github.com>
Co-authored-by: Josh Moore <josh.moore@jmoore.dev>
Co-authored-by: RikoDEV <18230443+RikoDEV@users.noreply.github.com>
Co-authored-by: Randy <randypriv@gmail.com>
Co-authored-by: Kevin Decherf <kevin@kdecherf.com>
Co-authored-by: Lukas Läderach <lukas.laederach@3volutions.ch>
Co-authored-by: 刘岗 <seesawliu@gmail.com>
Co-authored-by: Lemonawa <lemonawa1209@gmail.com>
Co-authored-by: Ilham Syahid S <ilhamsyahids@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Juan Camilo González <j.gonzalezj@uniandes.edu.co>
Co-authored-by: Wonderfall <wonderfall@protonmail.com>
Co-authored-by: pajecawav <pajecawav@gmail.com>
Co-authored-by: Holger Huo <holgerhuo@outlook.com>
Co-authored-by: RubenD <ruben@winterrific.net>
Co-authored-by: Brian Cao <bcao01@blueshieldca.com>
Co-authored-by: Alessio Forti <info@alessioforti.it>
Co-authored-by: ym-project <ym-project@protonmail.com>
Co-authored-by: isNullOrEmpty() <zxilly@outlook.com>
Co-authored-by: Steven DUBOIS <git@duboiss.fr>
Co-authored-by: rohandebsarkar <rohandebsarkar@gmail.com>
Co-authored-by: Thomas Mair <thomas.mair86@gmail.com>
Co-authored-by: Pavan Gangireddy <pavangangireddy2@gmail.com>
Co-authored-by: MagicLike <contact.magiclike@protonmail.com>
Co-authored-by: zx900930 <zx900930@gmail.com>
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: Mohammad Amin Dehghani <m.a.dehghani609@gmail.com>
Co-authored-by: Bilguun Ochirbat <bilguun0203@gmail.com>
Co-authored-by: Felipe Valtl de Mello <3065339+valtlfelipe@users.noreply.github.com>
Co-authored-by: Dzung Do <dungdo@osd.vn>
Co-authored-by: Maxime-J <Maxime-J@users.noreply.github.com>
Co-authored-by: Francis Cao <franciscao@gmail.com>
Co-authored-by: ayewo <ayewo@users.noreply.github.com>
@elitan
Copy link

elitan commented Mar 26, 2024

You just need to add umami.disabled = true to local storage and your visits will be ignored.

is this documented somewhere other than your comment in this gh issue? Are there other localStorage variables we can set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed in dev Fixed in the dev branch
Projects
None yet
Development

No branches or pull requests

4 participants