Skip to content

feat: GA4 monetization/ad revenue reports #760

@saraichinwag

Description

@saraichinwag

Summary

Leverage GA4's built-in monetization reports as a partial solution for ad revenue visibility when direct Mediavine API access isn't available.

Context

Mediavine doesn't have a public API (#757). GA4 has some ad revenue data that could be useful:

  • Ad revenue — estimated from AdSense/other ad integrations
  • Publisher ads — impressions, clicks, revenue
  • E-commerce — if SMI sales are tracked as events

GA4 Metrics Available

From GA4 Data API:

  • totalAdRevenue — estimated ad revenue
  • publisherAdClicks — ad clicks
  • publisherAdImpressions — ad impressions
  • buyerTaxonomy — for e-commerce attribution

Proposed Enhancement to datamachine/get-ga4-analytics

Add metrics parameter that includes:

{
  "metrics": ["sessions", "pageviews", "adRevenue", "adImpressions"],
  "dimensions": ["pagePath", "date"],
  "period": "30d"
}

Output:

{
  "success": true,
  "rows": [
    {
      "page_path": "/spiritual-meaning-crows/",
      "sessions": 1500,
      "pageviews": 2100,
      "ad_revenue": 12.34,
      "ad_impressions": 45000,
      "rpm": 8.23
    }
  ]
}

Limitations

  • GA4 ad revenue is estimated, not actual Mediavine payments
  • May not match Mediavine dashboard exactly
  • Useful for trends and relative comparison, not exact accounting

Priority

Medium — useful for revenue visibility, but not a complete solution. Better than nothing if Mediavine scraping is too fragile.

Related

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