-
Notifications
You must be signed in to change notification settings - Fork 218
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 APPLY_FILTER analytics event #2423
Conversation
dbbc8d1
to
830c504
Compare
Size Change: +96 B (0%) Total Size: 840 kB
ℹ️ View Unchanged
|
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.
If we want to debounce this it should be added here, otherwise there will be a time span where the event happens far more often than otherwise, making it harder to understand the rate of the event being sent per session.
However, if we debounced it, what would we send? In debouncing, would we still send individual events per filter value changed? In that case, don't bother debouncing. We only debounce the filter changes being sent to search to prevent unnecessary search requests. If we debounced and combine all the updated filters into a single event, that might be worth it, but would slightly change the way this event would be queried. It would probably warrant a slightly different API to make it easier to tell both what filters are applied and how often a particular filter is applied then unapplied (which might imply the filter isn't as useful as others).
830c504
to
5e3757f
Compare
Olga and I chatted a bit yesterday and we concluded we should try without debouncing these. The only reason to debounce would be perceived performance for the user or performance of the |
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.
This works perfectly. However, I think we're missing a property for if the filter is being enabled or disabled in the payload. This was the original intention of the "value" property, but the way it's implemented here makes sense to me so I think we just need an additional property.
5e3757f
to
9ba0f8c
Compare
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.
LGTM! Works well.
Fixes
Fixes #1070 by @dhruvkb
Description
This PR adds
APPLY_FILTER
event sent when the user selects a filter.We might want to debounce it, I'm not sure if I should add it here?
Some unrelated changes were also added to clean up the unused ref, and use
storeToRefs
pinia helper to reduce the number of computeds used in the file.Testing Instructions
Try clicking on the filters (both in the modal on mobile screen, and the sidebar on the desktop). You should see the event logged in the console, and tracked in Plausible at 0.0.0.0:50288 (if you run
just frontend/up
andjust frontend/init
as described in https://docs.openverse.org/frontend/guides/analytics.html).Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin