Skip to content

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Jan 6, 2026

Summary

  • Updated formatCPM() function to extract rate from AdCP spec's pricing_options[0].rate field
  • Added support for auction pricing via pricing_options[0].price_guidance.p75
  • Maintains backwards compatibility with deprecated product.cpm field
  • Added null safety and improved display when pricing is unavailable

Problem

The UI was looking for product.cpm (a deprecated field), but the AdCP spec moved pricing to pricing_options[].rate. Products were displaying "Contact for pricing" even when valid pricing data was returned in the pricing_options array.

Test plan

  • Verify products with pricing_options[0].rate display correct price (e.g., $6.01)
  • Verify products with auction pricing show ~$X format
  • Verify products with deprecated cpm field still work
  • Verify products without pricing show "Contact for pricing"

🤖 Generated with Claude Code

The UI was looking for `product.cpm` (deprecated field) but the AdCP spec
moved pricing to `pricing_options[].rate`. This fix:

- Updates `formatCPM()` to extract rate from `pricing_options[0].rate`
- Handles auction pricing via `pricing_options[0].price_guidance.p75`
- Falls back to deprecated `product.cpm` for backwards compatibility
- Adds null safety and improves display when pricing is unavailable
- Uses `~$` prefix for auction guidance prices to indicate estimate

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley force-pushed the bokelley/fix-cpm-pricing-display branch from b3ffd94 to 7aa38ec Compare January 6, 2026 13:30
@bokelley bokelley merged commit 929a08f into main Jan 6, 2026
7 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