Skip to content

Cookies set even when excluded #580

@krystof-k

Description

@krystof-k

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:

  1. 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.

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions