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

feat (api): Adds ability for click insights events to be triggered #1916

Merged
merged 8 commits into from
Jun 15, 2023

Conversation

8bittitan
Copy link
Contributor

Recently we added insights options for DocSearch in #1904. This PR now also adds in the ability for click analytics to be triggered as well when insights option is active.

@netlify
Copy link

netlify bot commented Jun 12, 2023

Deploy Preview for docsearch canceled.

Name Link
🔨 Latest commit ab3f94f
🔍 Latest deploy log https://app.netlify.com/sites/docsearch/deploys/648b11e220f2d40008beb68d

Copy link
Contributor

@levimichael levimichael left a comment

Choose a reason for hiding this comment

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

Cool! 🥳

item: InternalDocSearchHit,
itemPosition: number
): InsightsParamsWithItems<ClickedObjectIDsAfterSearchParams> {
const insightsItem = item as AlgoliaInsightsHit;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we run into issues with this assertion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, if we have an insights plugin active the needed attributes are added to the item. All AlgoliaInsightsHit type adds is better typings for the __autocomplete_* attributes.

8bittitan and others added 2 commits June 14, 2023 10:02
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
@8bittitan 8bittitan merged commit cacade4 into main Jun 15, 2023
@8bittitan 8bittitan deleted the feat/docsearch-click-insights-events branch June 15, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants