-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add event exclusion feature to funnels #5607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff @alexkim205! Some feedback inline and below,
- I can select exclusions within the same step.
- When adding a new exclusion step, maybe we should default to Pageview too? Not sure, CC @clarkus
- UI doesn't look great on smaller screens (13" MB), think we could fit the dropdowns in a single line and align the remove button better.
- While testing things out I realized that having a hide/disable button could be quite useful as when you apply these filters you want to quickly notice the difference in numbers with and without the filter, could adding this behavior be helpful? CC @clarkus
- Noticed some weird behavior (though not sure if this is Core Analytics scope, CC @neilkakkar). Tested using vanilla demo data. Without the exclusion step my universe is 43 users, yet when I apply the exclusions step, not only are users excluded from converting to step 2, but also they're removed from consideration since step 1.
frontend/src/scenes/insights/InsightTabs/FunnelTab/FunnelSecondaryTabs.tsx
Outdated
Show resolved
Hide resolved
frontend/src/scenes/insights/InsightTabs/FunnelTab/FunnelSecondaryTabs.tsx
Outdated
Show resolved
Hide resolved
Thanks @paolodamico!
Fixed!
Hmm, I tested this out initially but the width of the left options space was too small to fit three dropdowns in one single line without hiding all the text in the fields. Perhaps keeping this column format, but expanding the step dropdowns to their full width would fill out the container a bit better? What do you think? |
Think this definitely looks a lot better! Though I think my suggestion would be: |
I think we should keep it right aligned. That's somewhat of an established pattern in other repeating series we have - tables, filters, etc. If it varies position it's going to cause more confusion than the wrapping rows of elements. I'd rather we drop the arrow icon instead if we're looking for a short term way to save space. I don't think we need to wrap rows. If we drop the arrow icons and optimize for a minimum width of 320px on the container, it will fit. We could also benefit from some kind of row marker for each distinct exclusion step. We use numbers in the funnel steps, here we could do the same or just use some other indicator. Longer term, this component would really benefit from some standardization. I've been working on that problem, but I need a bit more time to finish work on some edge cases. |
Definitely on the right alignment, I meant keeping it to the right but on the same horizontal line as the event/action selector. Dropping the arrow also makes a lot of sense. |
Thanks for waiting! It took a while to style it like this because Action filter rows are nested deeply inside a component that's used everywhere. I added a new prop called I also tweaked our funnel tab breakpoints so that all dropdowns can fit in a single row. Here's how the new filter looks now: Screen.Recording.2021-08-19.at.3.27.12.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I gave the code a look and played with the feature a bit.
First, is this excluded on postgres?
Second, I think there are ways the data model can be used. Ideally we'd just store everything inside the filter without using any local state: no useState in a component and no extra reducers in a logic. There may be reasons why that's not a good idea (defaults? ux limitations?), and let me know if so.
Third, I'm not sure how it should work :D. I'm locally excluding all users that ever did a pageview between all the pageviews, but no matter what exclusion I apply, nothing changes:
I might be misunderstanding how it works, but I'd expect to see no results with something like this. CC @neilkakkar
frontend/src/scenes/insights/InsightTabs/FunnelTab/FunnelExclusionsFilter.tsx
Outdated
Show resolved
Hide resolved
@mariusandra thanks for raising the functionality issue. Excluding the same event as the one in the funnel shouldn't be possible! I'll update the backend to return nothing here, but maybe the frontend should warn as well - that this operation doesn't make sense. Specifically, when you have an exclusion on event A between step X and Y, then the funnel steps from X to Y can't be A. Edit: Actually, no, I'm thinking I should raise a ValidationError, and you can then display the error message as you see fit? |
I think there are still outstanding issues from my last review. In addition to that, now that #5668 is in, we should improve this flow somewhat: It's weird to get such an error during seemingly normal operations. Perhaps leaving the default event for exclusions empty will be enough? Though I'd love to also see the error message somewhere in the interface. |
Thanks for the review @mariusandra and @neilkakkar for implementing that error. I've updated the PR description w/ my updates!
Thats a good catch. This is CH exclusive feature so we should protect this behind some flag.
Gotcha just built out the below warning state for this use case. Screen.Recording.2021-08-23.at.4.30.54.PM.movOther changes made:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks good! I can't guarantee I caught all bugs during the review and testing, but did notice that now funnels on dashboards had a small regression. Something to still fix before this is ready.
Got some approvals and blocked on some funnel filters work so gonna go ahead and merge this one |
Changes
This PR adds the ability to exclude events between funnel steps.
Closes #5553.
Addresses part of #5367.
<ActionFilter/>
<FunnelExclusionsFilter/>
BlockingEmptyState
andCoexistingEmptyState
in code).Because this is a bit of a chunky PR, I'll CC a few people for focused reviews.
Demo
Snip.mov
Horizontal view
Vertical view
Screen.Recording.2021-08-18.at.2.31.08.PM.mov
Exclusion filters are invalid
Screen.Recording.2021-08-23.at.4.30.54.PM.mov
Checklist