diff --git a/frontend/src/stores/media/index.ts b/frontend/src/stores/media/index.ts index d8194a433ad..ce6c0d906cc 100644 --- a/frontend/src/stores/media/index.ts +++ b/frontend/src/stores/media/index.ts @@ -485,9 +485,13 @@ export const useMediaStore = defineStore("media", { let errorData: FetchingError | undefined if (page == 1) { + const searchStore = useSearchStore() + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { searchType, ...paramsWithoutSearchType } = + searchStore.searchParamsForEvent $sendCustomEvent("GET_SEARCH_RESULTS", { + ...paramsWithoutSearchType, mediaType: mediaType, - query: queryParams.q, resultsCount: mediaCount, }) } diff --git a/frontend/src/stores/search.ts b/frontend/src/stores/search.ts index 82438409bcc..4075e84ac42 100644 --- a/frontend/src/stores/search.ts +++ b/frontend/src/stores/search.ts @@ -244,7 +244,7 @@ export const useSearchStore = defineStore("search", { searchParamsForEvent(): SearchParamsForEvent { return { kind: this.strategy === "default" ? "search" : "collection", - query: this.searchTerm, + query: this.strategy === "default" ? this.searchTerm : "null", searchType: isSearchTypeSupported(this.searchType) ? this.searchType : ALL_MEDIA, diff --git a/frontend/src/types/analytics.ts b/frontend/src/types/analytics.ts index 7e63ac2878f..006e18b25ca 100644 --- a/frontend/src/types/analytics.ts +++ b/frontend/src/types/analytics.ts @@ -88,11 +88,9 @@ export type Events = { * - How often are searches returning fewer than one page of results? * - How many results do most searches yield? */ - GET_SEARCH_RESULTS: { + GET_SEARCH_RESULTS: Omit & { /** the media type being searched */ mediaType: SupportedMediaType - /** The search term */ - query: string /** The number of results found for this search */ resultsCount: number }