I ran into an issue that I believe is a bug.
When a user is excluded via Ahoy.exclude_method (e.g., using Flipper to disable tracking for certain users), the visit is correctly not stored in the database. However, the ahoy_visit and ahoy_visitor cookies are still set.
This causes two issues:
-
Broken tracking after exclusion ends. When the user is later enabled for tracking (e.g., Flipper flag changed), visits are not tracked until the cookie expires.
-
GDPR compliance. Setting tracking cookies for users who are explicitly excluded from tracking is problematic – no tracking is actually performed, but the cookie is still being set. If someone uses exclude_method to respect a user's cookie consent choice, it could be a compliance issue.
Happy to submit a PR with a fix if this is not intended behavior.
I ran into an issue that I believe is a bug.
When a user is excluded via
Ahoy.exclude_method(e.g., using Flipper to disable tracking for certain users), the visit is correctly not stored in the database. However, theahoy_visitandahoy_visitorcookies are still set.This causes two issues:
Broken tracking after exclusion ends. When the user is later enabled for tracking (e.g., Flipper flag changed), visits are not tracked until the cookie expires.
GDPR compliance. Setting tracking cookies for users who are explicitly excluded from tracking is problematic – no tracking is actually performed, but the cookie is still being set. If someone uses
exclude_methodto respect a user's cookie consent choice, it could be a compliance issue.Happy to submit a PR with a fix if this is not intended behavior.