8000 feat: Support `coupon`s for Revenue Analytics by rafaeelaudibert · Pull Request #33771 · PostHog/posthog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Support coupons for Revenue Analytics #33771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 17, 2025

Conversation

rafaeelaudibert
Copy link
Member

We can now filter/breakdown both by the coupon in a specific revenue event, but also the initial coupon used by a person on their first invoice.

@rafaeelaudibert rafaeelaudibert requested review from a team, lricoy, robbie-c and jabahamondes and removed request for a team June 16, 2025 21:09
Copy link
Contributor
@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added support for coupon analytics in Revenue Analytics, enabling filtering and breakdown by both event-specific coupons and initial customer coupons in PostHog.

  • Implemented taxonomy support for four new coupon properties: coupon, coupon_id, initial_coupon, and initial_coupon_id in taxonomy/taxonomy.py
  • Enhanced LemonInputSelect component to support tooltips on dropdown options for better UX when selecting coupon filters
  • Added coupon-related query support in HogQL by extending RevenueAnalyticsInvoiceItemView and RevenueAnalyticsCustomerView with proper Stripe invoice data extraction
  • Fixed critical issue in new_option_for_filters_and_group_by.md guide where subquery variable assignment was removed without alternative
  • Extended RevenueAnalytics schema and insights query runner to handle new coupon grouping and filtering capabilities

13 files reviewed, 5 comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor
github-actions bot commented Jun 16, 2025

Size Change: +318 B (+0.01%)

Total Size: 2.57 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 2.57 MB +318 B (+0.01%)

compressed-size-action

Copy link
Contributor
@jabahamondes jabahamondes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice PR to review EOD 🚀

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated 8000

16 snapshot changes in total. 0 added, 16 modified, 0 deleted:

  • chromium: 0 added, 16 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Member
@robbie-c robbie-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this could have been 2 separate PRs (ci changes and everything else) but LGTM

rafaeelaudibert and others added 7 commits June 17, 2025 12:17
This could be achieved with `labelComponent` but it's much easier to achieve with a custom prop
We can now filter/breakdown both by the coupon in a specific revenue event, but also the initial coupon used by a person on their first invoice.
We can make this much simpler by extracting some of the logic to some different methods
This avoids the need to run this twice: dagster AND backend
@rafaeelaudibert rafaeelaudibert force-pushed the add-fliter-and-breakdown-by-coupon branch from 2baccfa to afefcfe Compare June 17, 2025 15:17
@rafaeelaudibert rafaeelaudibert enabled auto-merge (squash) June 17, 2025 15:17
@rafaeelaudibert rafaeelaudibert force-pushed the add-fliter-and-breakdown-by-coupon branch from ee8def8 to 3a4b4fd Compare June 17, 2025 15:57
@rafaeelaudibert rafaeelaudibert merged commit 29f7328 into master Jun 17, 2025
101 checks passed
@rafaeelaudibert rafaeelaudibert deleted the add-fliter-and-breakdown-by-coupon branch June 17, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0