Skip to content
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(recommend): provide insights query parameters to recommend queries #6123

Draft
wants to merge 42 commits into
base: feat/map-recommend-results
Choose a base branch
from

Conversation

dhayab
Copy link
Member

@dhayab dhayab commented Apr 8, 2024

Summary

This PR updates the recommend queries with clickAnalytics and userToken to allow the API to properly enable event collection.

Result

Recommendations are now returned with a queryID and events sent from Recommend widgets send this value when insights is enabled in InstantSearch.

@dhayab dhayab added the Feature: Recommendations Providing recommendations of records or facets label Apr 8, 2024
Copy link

codesandbox-ci bot commented Apr 8, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b057a43:

Sandbox Source
react-instantsearch-app Configuration
example-react-instantsearch-default-theme Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-vue-instantsearch-default-theme Configuration

@dhayab dhayab changed the base branch from feat/recommend-fbt-connector to feat/map-recommend-results April 8, 2024 15:21
@dhayab dhayab changed the base branch from feat/map-recommend-results to feat/recommend-fbt-connector April 8, 2024 15:21
@dhayab dhayab force-pushed the feat/recommend-fbt-connector branch from 8498792 to 02de7c2 Compare April 9, 2024 09:48
@dhayab dhayab marked this pull request as draft April 9, 2024 09:50
@dhayab dhayab force-pushed the fix/helper-recommend-insights branch from a6c730c to e945286 Compare April 9, 2024 09:54
@dhayab dhayab marked this pull request as ready for review April 9, 2024 09:55
Comment on lines +1638 to +1640
queryParameters: Object.assign(query.queryParameters || {}, {
clickAnalytics: searchState.clickAnalytics,
userToken: searchState.userToken,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: If the client passes queryParameters to the recommend widget, do they "lose" automatic event collection ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is augmented thanks to Object.assign(), but it's a good idea to have a specific test for that, I'll add it to the PR.

@dhayab dhayab requested a review from raed667 April 9, 2024 13:18
Copy link

@raed667 raed667 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨✨✨ 💖 👍 WUNDERBAR 👍 💖 ✨✨✨

@dhayab
Copy link
Member Author

dhayab commented Apr 11, 2024

Moving this back to draft for now (see discussion thread).

@dhayab dhayab marked this pull request as draft April 11, 2024 08:04
Base automatically changed from feat/recommend-fbt-connector to feat/map-recommend-results April 23, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Recommendations Providing recommendations of records or facets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants