-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix(insights): control auto sending events w/ isAutoSendingHitsViewEvents
#314
Conversation
isAutoSendingHitsViewEvents
to enable/disable auto sending events
isAutoSendingHitsViewEvents
to enable/disable auto sending eventsisAutoSendingHitsViewEvents
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.
implementation looks good, just double checking if it could be breaking
if isAutoSendingHitsViewEvents { | ||
searcher.eventTracker.trackView(for: response.hits, eventName: "Hits Viewed") | ||
} |
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.
Could we rather send the view events as batches when the hits enter the viewport?
I'm afraid this PR solution creates more noise, especially for Personalization, which is our only product relying on search view events AFAIK. It blurs the signal because there's no guarantee that the user actually sees all the hits from the response.
I created a more correct approach in JavaScript for the Personalization Storefront, perhaps the principle could be reused?
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.
The library doesn't provide a UI components to display hits as far as I know :/
But indeed, this is something we can investigate later on.
Co-authored-by: Haroen Viaene <[email protected]>
Summary
Add
isAutoSendingHitsViewEvents
toHitsSearcher
. If set totrue
insights view events are automatically sent.The parameter defaults to
false
.FX-2875