Raccoglie eventi aggregati dietro consenso cookie, senza PII né tracking su admin/regia/live/replay; GA4 resta invariato. Co-authored-by: Cursor <cursoragent@cursor.com>
14 lines
395 B
Ruby
14 lines
395 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AnalyticsEvent < ApplicationRecord
|
|
self.table_name = "analytics_events"
|
|
|
|
EVENT_TYPES = %w[click scroll pageview].freeze
|
|
DEVICES = %w[mobile tablet desktop].freeze
|
|
|
|
validates :page_path, presence: true
|
|
validates :device, inclusion: { in: DEVICES }
|
|
validates :event_type, inclusion: { in: EVENT_TYPES }
|
|
validates :occurred_at, presence: true
|
|
end
|