-- v77: Registration source & acquisition attribution
-- Tracks where users originate from when registering their profiles

alter table public.profiles
  add column if not exists initial_referrer text,
  add column if not exists referrer_domain text,
  add column if not exists landing_path text,
  add column if not exists utm_source text,
  add column if not exists utm_campaign text;

-- Index for analytics and acquisition queries
create index if not exists idx_profiles_referrer_domain on public.profiles(referrer_domain);
create index if not exists idx_profiles_landing_path on public.profiles(landing_path);
