From 0febc8dabde82b6eef45303ace0d878c6ad53308 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Wed, 10 Apr 2024 14:26:27 +0200 Subject: [PATCH] enhance(search): track clicks on mobile, too --- site/search/SearchPanel.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/site/search/SearchPanel.tsx b/site/search/SearchPanel.tsx index 44ced77decc..207357ad79a 100644 --- a/site/search/SearchPanel.tsx +++ b/site/search/SearchPanel.tsx @@ -208,6 +208,17 @@ function ExplorerHit({ cardPosition: number }) { const firstHit = groupedHit.views[0] + + const exploreAllProps = { + href: `${BAKED_BASE_URL}/${EXPLORERS_ROUTE_FOLDER}/${groupedHit.explorerSlug}`, + "data-algolia-index": getIndexName(SearchIndexName.ExplorerViews), + "data-algolia-object-id": firstHit.objectID, + "data-algolia-position": firstHit.hitPositionOverall, + "data-algolia-card-position": cardPosition, + "data-algolia-position-within-card": 0, + "data-algolia-event-name": "click_explorer", + } + return (
Explore all {groupedHit.numViewsWithinExplorer} indicators @@ -273,8 +276,8 @@ function ExplorerHit({ ))} Explore all {groupedHit.numViewsWithinExplorer} indicators