Skip to content

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 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.

5 participants