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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a GDPR-compliant configuration for Ahoy #5504
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javierm
force-pushed
the
admin_stats_without_ahoy
branch
3 times, most recently
from
April 25, 2024 03:22
7e2a818
to
e456094
Compare
javierm
force-pushed
the
remove_ahoy_cookies
branch
from
April 25, 2024 03:22
6c00f24
to
e8a5e03
Compare
javierm
force-pushed
the
admin_stats_without_ahoy
branch
2 times, most recently
from
April 25, 2024 03:56
ea81e25
to
aa63a8d
Compare
javierm
force-pushed
the
remove_ahoy_cookies
branch
from
April 25, 2024 03:57
e8a5e03
to
1ef5320
Compare
javierm
force-pushed
the
admin_stats_without_ahoy
branch
from
April 25, 2024 04:04
aa63a8d
to
a1decc8
Compare
javierm
force-pushed
the
remove_ahoy_cookies
branch
from
April 25, 2024 04:06
1ef5320
to
4ec16e8
Compare
javierm
force-pushed
the
admin_stats_without_ahoy
branch
from
April 25, 2024 12:47
a1decc8
to
968a623
Compare
javierm
force-pushed
the
remove_ahoy_cookies
branch
2 times, most recently
from
April 25, 2024 21:52
56a30d8
to
6c02347
Compare
javierm
changed the title
Remove Ahoy cookies
Use a GDPR-compliant configuration for Ahoy
Apr 25, 2024
javierm
force-pushed
the
remove_ahoy_cookies
branch
from
April 25, 2024 21:59
6c02347
to
0756bb7
Compare
javierm
force-pushed
the
admin_stats_without_ahoy
branch
from
April 25, 2024 23:03
2812fe6
to
c8a8648
Compare
javierm
force-pushed
the
remove_ahoy_cookies
branch
from
April 25, 2024 23:15
0756bb7
to
34865b6
Compare
javierm
force-pushed
the
admin_stats_without_ahoy
branch
from
May 7, 2024 18:30
c8a8648
to
651f4d8
Compare
javierm
force-pushed
the
admin_stats_without_ahoy
branch
2 times, most recently
from
May 8, 2024 19:21
f4613b1
to
8dd5c78
Compare
javierm
force-pushed
the
remove_ahoy_cookies
branch
from
May 8, 2024 20:40
34865b6
to
10e7790
Compare
javierm
force-pushed
the
admin_stats_without_ahoy
branch
3 times, most recently
from
May 9, 2024 12:28
bab98f9
to
3fcac3a
Compare
This was added in commit 02f19aa, before we started tracking events. I don't think we ever used it; in any case, we now use the `Ahoy::Chart` class to deal with the stats Ahoy used to generate.
Geocoding is disabled by default since Ahoy 4.0 [1]. [1] https://github.com/ankane/ahoy/tree/v4.2.1?tab=readme-ov-file#upgrading
It's possible to use the `Ahoy::Tracker::UUID_NAMESPACE` since Ahoy 2.1.0 [1]. [1] ankane/ahoy@44f7956bad
As mentioned in Ahoy's README [1]: > Ahoy provides a number of options to help with GDPR compliance. > Update config/initializers/ahoy.rb with: > > class Ahoy::Store < Ahoy::DatabaseStore > def authenticate(data) > # disables automatic linking of visits and users > end > end > > Ahoy.mask_ips = true > Ahoy.cookies = :none As also mentioned in the README: > If Ahoy was installed before v5, add an index before making this > change. > (...) > For Active Record, create a migration with: > add_index :ahoy_visits, [:visitor_token, :started_at] However, the `visitor_token` doesn't exist in our table, since we generated the `visits` table when Ahoy used the `visitor_id` column. So we're using this column for the index. Note we also need to change the `visit` method, since otherwise we get an exception [2]. As mentioned on the issue reporting the exception: > you'll need to copy the latest version of that method and adapt it to > your model. I believe you'll want to replace: > > where(visit_token: ahoy.visit_token) with > where(id: ensure_uuid(ahoy.visit_token)) > > where(visitor_token: ahoy.visitor_token) with > where(visitor_id: ensure_uuid(ahoy.visitor_token)) So we're copying the latest version of that method and changing it accordingly. [1] https://github.com/ankane/ahoy/blob/v5.0.2/README.md [2] Issue 549 in https://github.com/ankane/ahoy
javierm
force-pushed
the
remove_ahoy_cookies
branch
from
May 9, 2024 12:57
10e7790
to
b6579a1
Compare
taitus
approved these changes
May 13, 2024
According to the README [1]: > To mask previously collected IPs, use: > Ahoy::Visit.find_each do |visit| > visit.update_column :ip, Ahoy.mask_ip(visit.ip) > end We're adapting the code with our version, since we use the `Visit` model instead of the `Ahoy::Visit` model. [1] https://github.com/ankane/ahoy/blob/v5.0.2/README.md#ip-masking
javierm
force-pushed
the
remove_ahoy_cookies
branch
from
May 13, 2024 13:00
b6579a1
to
144d1d8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Objectives
visit_id
column in the debates table