diff --git a/packages/x-components/src/x-modules/semantic-queries/components/semantic-queries.vue b/packages/x-components/src/x-modules/semantic-queries/components/semantic-queries.vue
index da1d2dfb53..af89b51114 100644
--- a/packages/x-components/src/x-modules/semantic-queries/components/semantic-queries.vue
+++ b/packages/x-components/src/x-modules/semantic-queries/components/semantic-queries.vue
@@ -43,11 +43,11 @@
diff --git a/packages/x-components/src/x-modules/tagging/wiring.ts b/packages/x-components/src/x-modules/tagging/wiring.ts
index 376bdc2f76..b3e84e4f1c 100644
--- a/packages/x-components/src/x-modules/tagging/wiring.ts
+++ b/packages/x-components/src/x-modules/tagging/wiring.ts
@@ -1,4 +1,4 @@
-import { Taggable, Tagging, TaggingRequest } from '@empathyco/x-types';
+import { SemanticQuery, Taggable, Tagging, TaggingRequest } from '@empathyco/x-types';
import { DefaultSessionService } from '@empathyco/x-utils';
import {
namespacedWireCommit,
@@ -206,6 +206,35 @@ export function createTrackWire(property: keyof Tagging): Wire {
);
}
+/**
+ * Performs a track of a query with no results that used semantics as fallback.
+ * The totalHits will be changed to -1 if semantic queries are found in order to differentiate
+ * it from scenarios where the user encounters a no-results page without any semantic queries.
+ *
+ * @public
+ */
+export const trackNoResultsQueryWithSemanticsWire = filter(
+ wireDispatch('track', ({ eventPayload, state }) => {
+ const { queryTaggingInfo } = state;
+ const totalHits = (eventPayload as SemanticQuery[]).length > 0 ? -1 : 0;
+ return {
+ params: { ...queryTaggingInfo?.params, totalHits },
+ url: queryTaggingInfo?.url ?? ''
+ };
+ }),
+ ({ store }) => Number(store.state.x.tagging.queryTaggingInfo?.params.totalHits)! === 0
+);
+
+/**.
+ * Debounced version of {@link trackNoResultsQueryWithSemanticsWire}
+ *
+ * @public
+ */
+export const trackNoResultsQueryWithSemanticsWireDebounced = moduleDebounce(
+ trackNoResultsQueryWithSemanticsWire,
+ ({ state }) => state.config.queryTaggingDebounceMs
+);
+
/**
* Factory helper to create a wire for the track of the display click.
*
@@ -298,8 +327,8 @@ export const taggingWiring = createWiring({
trackDisplayClickedWire,
setQueryTaggingFromQueryPreview
},
- QueryTaggingWithNoResults: {
- setQueryTaggingWithNoResults
+ SemanticQueriesResponseChanged: {
+ trackNoResultsQueryWithSemanticsWireDebounced
},
ModuleRegistered: {
setHasSemantics