Skip to content

Add RPM-based estimated revenue metric using public YouTube data#10

Merged
mhaadiabu merged 3 commits into
mainfrom
copilot/add-rpm-based-revenue-metric
Apr 13, 2026
Merged

Add RPM-based estimated revenue metric using public YouTube data#10
mhaadiabu merged 3 commits into
mainfrom
copilot/add-rpm-based-revenue-metric

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown

YouTube's estimatedRevenue is only accessible post-OAuth. This adds a proxy metric — RPM × views — derived entirely from public channels.list fields, visible before any authentication.

New utility: src/lib/revenue-estimate.ts

Maps topicDetails.topicCategories URLs to industry-standard RPM benchmarks and applies (totalViews / 1000) * RPM:

Niche RPM
Finance / Investing $18
Tech / Software $12
Education $8
Gaming $4
Entertainment / Vlogging $3
Default $4
export function estimateRevenueFromViews(
  totalViews: number,
  topicCategories: string[] = [],
): number {
  const rpm = getRpmForTopicCategories(topicCategories);
  return (totalViews / 1000) * rpm;
}

UI integration

  • Channel lookup — replaces the static "Revenue Access: not available" card with an "Estimated Revenue" card showing the RPM estimate and ESTIMATED_REVENUE_DISCLAIMER
  • Influencers table — Revenue Input column shows RPM estimate (labeled "Estimated Revenue") for channels with public view data but no confirmed manual/analytics revenue
  • Analytics – Source Risk Review — shows RPM estimate inline for public-only channels

Precedence

Confirmed estimatedAnnualRevenue (manual inputs, YouTube Analytics OAuth, tax estimates) always takes priority. The proxy only renders when no confirmed revenue exists.

All values are displayed in USD with the disclaimer: "Based on public view data and industry-average RPM. Connect your YouTube account for exact figures."

Original prompt

Background

The app works with YouTube creator data. YouTube's estimatedRevenue field is private and only available when a creator authenticates with their YouTube account. We need a standard proxy metric for revenue estimation that works using publicly available YouTube data, visible to all users before they authenticate.

Goal

Implement an RPM-based estimated revenue metric using only public YouTube Data API fields.

Formula

Estimated Revenue = (Total Views / 1000) * RPM

Where RPM (Revenue Per Mille) is the estimated revenue per 1,000 views, using industry-standard benchmarks.

RPM Benchmark Values

Map channel topic/category to an RPM value. Use the following ranges (use the midpoint or a conservative value):

Niche RPM
Finance / Investing $18
Tech / Software $12
Education $8
Gaming $4
Entertainment / Vlogging $3
General / Mixed (default) $4

These categories should be derived from topicDetails.topicCategories on the YouTube channel object if available, otherwise fall back to the default of $4.

Public YouTube Data API Fields to Use

  • statistics.viewCount from channels.list - total channel views
  • topicDetails.topicCategories from channels.list - to determine niche/RPM

Implementation Requirements

  1. Create a utility function (e.g. estimateRevenueFromViews) that:

    • Accepts total view count and optionally a topic category list
    • Maps topic categories to an RPM value
    • Returns the estimated revenue using the formula above
  2. Integrate this estimated revenue value wherever channel analytics or revenue data is displayed in the app.

  3. When estimatedRevenue from YouTube (the authenticated metric) is available, it should take precedence over this proxy metric.

  4. Display a clear label or note alongside the metric indicating it is an estimate based on public data and industry-average RPM (e.g. "Based on public view data and industry-average RPM. Connect your YouTube account for exact figures."). Keep the note concise and factual — no marketing language.

Style and Code Notes

  • No emoji anywhere in code, comments, labels, or UI text.
  • Follow the existing TypeScript patterns and code style in the repo.
  • Place utility logic in an appropriate shared/utils location consistent with the existing project structure.
  • Make sure the metric is clearly labeled as "Estimated Revenue" in the UI, not just "Revenue", to avoid confusion with real revenue data.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: I want us to have a metric for revenue estimation when real revenue data is not accessed yet. a standard metric to work with. what do you think is the best suited for this?

User: @Copilot Accepted Confirmation: Are you sure?

Assistant: I've kicked off a deep research session to explore the codebase — understanding the product type, data models, and any existing analytics logic will help me recommend the most fitting proxy metric for revenue estimation.

data:
    - title: Understand the overall purpose and domain of this application. What kind of prod...
      repository: mhaadiabu/graitld
      url: https://github.com/mhaadiabu/graitld/tasks/5aa1d62e-6945-4349-a684-b04fdd6104e9
      state: queued

While that runs, here's the general thinking framework I'll apply once results come back:

The best proxy metric depends on the business model:

Business Type Best Revenue Proxy Metric
SaaS / Subscription MRR (Monthly Recurring Revenue) = Active Users × ARPU
Marketplace / Platform GMV (Gross Merchandise Value) = Transactions × Avg Order Value
Freemium / Conversion funnel Qualified Pipeline Value = Signups × Conversion Rate × ARPU
Usage-based / API Estimated Consumption Revenue = Active Usage Units × Unit Price
E-commerce Projected Revenue = Sessions × Conversion Rate × Avg Order Value

Once the research is done, I'll map it to your actual app structure and propose a concrete formula + metric name you can wire into your dashboard/analytics layer. Stay tuned! 🎯

User: I want the metric based on publicly available youtube data in the app. the estimatedRevenue provided by Youtube is private and is setup to work in the app only when creators authenticate with their YT accounts.

Assistant: Great context! So the app works with YouTube creator data, and estimatedRevenue is only available post-authentication. You need a public data-based proxy that approximates revenue before a creator connects their account.

The industry-standard approach for this is:


📊 Recommended Metric: Estimated RPM-based Revenue

Formula:

Estimated Revenue = (Total Views / 1,000) × RPM

Where RPM (Revenue Per Mille) = revenue per 1,000 views — using a publicly accepted benchmark.


Why this works:

  • Views are fully public via t...

This pull request was created from Copilot chat.

@vercel

vercel Bot commented Apr 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
graitld Ready Ready Preview, Comment Apr 13, 2026 7:19pm

…actor analytics page

Agent-Logs-Url: https://github.com/mhaadiabu/graitld/sessions/dd5e0932-a3cc-4a3b-a4a3-8dc74254376c

Co-authored-by: mhaadiabu <140342507+mhaadiabu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add RPM-based estimated revenue metric using public data Add RPM-based estimated revenue metric using public YouTube data Apr 13, 2026
Copilot AI requested a review from mhaadiabu April 13, 2026 19:20
@mhaadiabu mhaadiabu marked this pull request as ready for review April 13, 2026 19:41
@mhaadiabu mhaadiabu merged commit c2b5e26 into main Apr 13, 2026
3 checks passed
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.

2 participants