Allow revenue metrics to be queried with session dimensions#6211
Allow revenue metrics to be queried with session dimensions#6211
Conversation
lib/plausible/stats/table_decider.ex
Outdated
| |> dimensions_used_in_filters() | ||
| |> Enum.any?(&(dimension_partitioner(query, &1) == :session)) | ||
|
|
||
| group_session_dims = |
There was a problem hiding this comment.
This is needed not for the dashboard but for API. In the dashboard we always add a [:is_not, "visit:entry_page", ""] filter to queries so checking filters is enough. We can't expect that there's always a filter present in API queries.
There was a problem hiding this comment.
Would it make sense to extend the check the same way sessions_join_events? ?
lib/plausible/stats/table_decider.ex
Outdated
| |> dimensions_used_in_filters() | ||
| |> Enum.any?(&(dimension_partitioner(query, &1) == :session)) | ||
|
|
||
| group_session_dims = |
There was a problem hiding this comment.
Would it make sense to extend the check the same way sessions_join_events? ?
@zoldar no, the line on guards against session metrics being requested for event dimensions so adding the same extension tosessions_join_events would be a no-op.
I had to change |
|
@ukutaht got it. If that would ever change and there would be similar exclusions the other way around, the logic would have to be altered anyway and doing that up front would only muddle it up. |
RobertJoonas
left a comment
There was a problem hiding this comment.
Thanks for this @ukutaht! Looks good to me! 👍
Changes
Allows revenue metrics to be queries with session dimensions. Prepares for refactoring entry page breakdown to APIv2 code.
Tests
Changelog
Documentation
Dark mode