Skip to content

feat: UTM digest tracking + AE last-viewed roster#51

Closed
m1lestones wants to merge 1 commit into
mainfrom
feat/digest-tracking
Closed

feat: UTM digest tracking + AE last-viewed roster#51
m1lestones wants to merge 1 commit into
mainfrom
feat/digest-tracking

Conversation

@m1lestones

Copy link
Copy Markdown
Collaborator

What this does

Closes the loop on whether AEs are actually opening the Monday digest.

  • DigestTracker — fixed to read ae_id from URL params instead of hardcoding Danielle's ID. Fires on ?utm_source=digest&ae_id=<uuid>&digest_id=<uuid>.
  • /api/digest-view — new Next.js route. Stores views in Supabase digest_views table (upsert by ae_id) and also forwards to your /api/v1/digest-views endpoint silently.
  • DigestRoster — Danielle sees a "Digest · Last Opened" panel on the home page showing each AE with a green dot + time ago, or "not opened".

What Joel needs to do

1. Run this in Supabase:

CREATE TABLE IF NOT EXISTS digest_views (
  ae_id uuid PRIMARY KEY,
  digest_id text,
  viewed_at timestamptz DEFAULT now()
);

2. In format_weekly_digest(), append UTM params to every dashboard link:

?utm_source=digest&digest_id={digest_id}&ae_id={ae_user_id}

That's it — frontend handles everything else. The Supabase write works independently of your endpoint, so this is safe to merge before your digest endpoint is live.

No dependencies on feat/mobile-polish

This PR is based off main and can be merged in any order.

🤖 Generated with Claude Code

DigestTracker now captures ae_id from URL params (?utm_source=digest&ae_id=xxx)
instead of using a hardcoded ID. Views stored in Supabase digest_views table
and forwarded to backend endpoint. DigestRoster shows Danielle each AE's
last digest open time on the home page admin view.

Requires Joel to:
1. CREATE TABLE digest_views (ae_id uuid PRIMARY KEY, digest_id text, viewed_at timestamptz DEFAULT now());
2. Append ?utm_source=digest&digest_id={id}&ae_id={ae_id} to all digest links
@m1lestones

Copy link
Copy Markdown
Collaborator Author

Closing — merged into feat/mobile-polish instead to keep everything together before Demo Day.

@m1lestones m1lestones closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant