Skip to content

feat: Revenue attribution — traffic source → income mapping #758

@saraichinwag

Description

@saraichinwag

Summary

Combine traffic data (GA4, Pinterest, Bing) with revenue data (SMI, Mediavine) to answer strategic questions about what content actually makes money.

The Problem

Agent can currently see:

But cannot answer:

  • "Which traffic source generates the most revenue?"
  • "Is Pinterest traffic more valuable than search traffic?"
  • "Which content category has the highest RPM?"
  • "What should I create more of to maximize income?"

Proposed Solution

Create a revenue attribution ability that:

  1. Joins traffic + revenue data by post/page and time period
  2. Calculates RPM by source — revenue per 1000 sessions from Pinterest vs search vs direct
  3. Identifies high-value content — posts that generate both traffic AND revenue
  4. Tracks conversion rates — SMI sales / pageviews by post

Proposed Ability: datamachine/get-revenue-attribution

Input:

  • period — time range (7d, 30d, 90d)
  • dimension — by_traffic_source, by_category, by_post, by_author
  • limit — top N results

Output:

{
  "success": true,
  "period": "30d",
  "by_traffic_source": [
    {
      "source": "pinterest",
      "sessions": 15000,
      "revenue": 450.00,
      "rpm": 30.00
    },
    {
      "source": "google",
      "sessions": 500,
      "revenue": 5.00,
      "rpm": 10.00
    }
  ],
  "by_category": [...],
  "top_performing_posts": [...]
}

Dependencies

Priority

Medium-High — strategic decision-making requires this, but depends on revenue data abilities first.

Status

Blocked by #756 and #757. Spec for future implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions