ankane / ahoy

Simple, powerful, first-party analytics for Rails
MIT License
4.2k stars 377 forks source link

GDPR Checklist #358

Closed ankane closed 6 years ago

ankane commented 6 years ago

Summary

IP masking, anonymity sets, and no more cookies

Checklist

Completed items are on master branch

IP Masking

Same approach as Google Analytics IP Anonymization

Anonymity Sets & Cookies

Instead of cookies, use the following formula for visit and visitor tokens.

uuid_v5("visit(or)/#{masked_ip_address}/#{user_agent}")

Visitors with the same masked IP address (see above) and user agent combo will be grouped together into an anonymity set

Note: Visits have an infinite duration - one approach is to add the current date/week to the hash, but this will interfere with active visits during switchover

Readme instructions

Update config/initializers/ahoy.rb to:

class Ahoy::Store < Ahoy::DatabaseStore
  def authenticate(data)
    # do not link visits and users automatically
  end
end

Ahoy.mask_ips = true
Ahoy.cookies = false

If you use JavaScript tracking, set:

ahoy.configure({cookies: false});

Notes

Resources

rauhryan commented 6 years ago

This is great! thank you guys

Just started pulling ahoy into our app and excited to see this coming

Much appreciated and I'll try and help out if I find an opportunity

ankane commented 6 years ago

Just released 2.1.0 with this

tolhzar commented 6 years ago

Note: Visits have an infinite duration - one approach is to add the current date/week to the hash, but this will interfere with active visits during switchover

@ankane is there a way to expire visit or set a duration somehow in that case?

ACPK commented 5 years ago

@ankane - Using Javascript, how would I allow Ahoy to track the user based on the user's answer to a "GDPR-compliant cookies notice"?

We'd also like to be able to automatically it off on certain sections of the site rather than application-wide.

iamajvillalobos commented 4 years ago

With GDPR settings on, can we still get unique visits properly?