- Shipped
- August 24, 2026 at 11:47 PM UTC
- Author
- Kamo
- Commit
- 133bab1
GET **************** answers this organisation's top ten for one metric over one window, plus the caller's own standing when they are not on it. The counters on MARKETING_TRACKING_CODES cannot back this: they are all-time roll-ups with no time dimension, and there is nothing in a running total that says when any of it happened. The windowed truth is in the rows — **************** for acquisition, and each conversion's own *_AT stamp on MARKETING_VISITORS. Which is also why All Time agrees with the code grid: same data, counted the same way, not a second bookkeeping. Four decisions worth stating: - Acquisition is dated by FIRST contact, not by activity. Counting visitors who were merely active in the window would re-credit the same person every month, so work done once would out-rank work done now, forever. - Conversions rank by attributedTrackingCodeId alone. That column freezes the moment an account exists; lastTrackingCodeId keeps moving, and ranking off it would let one member take another's closed conversion with an extra click. - The window is cut in the MEMBER's calendar and compared in UTC. "This month" differs by up to a day depending on whose calendar is asked, and every column in this schema is an offset-free LocalDateTime meaning UTC. - All four metrics are computed per request, so switching category is an instant re-sort of rows already on screen rather than a spinner. Gated on AFFILIATE_SCOREBOARD_WIDGET and nothing else — see the right's own javadoc. It buys no drill-down: there is no code id, no visitor id and no member parameter on the endpoint, and every by-id analytics endpoint still goes through MarketingTrackingScopeResolver unchanged. The four aggregations use the comma-join rather than JOIN..ON because neither foreign key is a JPA association and the comma form parses on every Hibernate version the fleet runs — MarketingTrackingHqlTest now parses all four against the real entity model on 6.2.13, and pins the acquisition, attribution and tenant predicates that fail silently if they drift.