Hybrid Search — Interactions
See what the Hybrid Search workflow reports to Miso as a reader uses the results and the answer, and send the same records yourself when you render part of it on your own.
Each record is an interaction: a reader saw, scrolled to, clicked or rated something. Miso builds the search and answer metrics in Dojo from them. Below we list the interactions Hybrid Search sends, the fields Miso needs on each one, and then send one by hand.
You need a working Hybrid Search page first. See Hybrid Search — Quick Start.
What Hybrid Search sends
The SDK watches each part of the page and sends an interaction when the
reader acts on it. property names the part:
| Property | Element | Types | Subject |
|---|---|---|---|
products | <miso-products> | impression, viewable_impression, click | product_ids of the results |
sources | <miso-sources> | impression, viewable_impression, click | product_ids of the articles |
images | <miso-images> | impression, viewable_impression, click | product_ids of the images |
affiliation | <miso-affiliation> | impression, viewable_impression, click | The affiliate products, with channel and positions |
answer | <miso-answer> | click | items, the link texts, with urls |
The answer has its own workflow, client.ui.hybridSearch.answer, but its
records go out as Hybrid Search records, with the same api_name and
workflow as the results.
A click on a citation in the answer, such as [2], counts as a click on that
source. It goes out as a sources click with event_target: "citation-link",
so you can tell it apart from a click in the source list.
The rating buttons send one more type. When the reader clicks Helpful or
Not helpful, Hybrid Search sends type: "feedback" with
result_type: "answer" and value set to helpful or unhelpful. A second
click on the same button clears the rating and sends value: "unselected".
This record has no property.
The types mean:
| Type | The reader |
|---|---|
impression | Has the part on the page, seen or not. |
viewable_impression | Has at least half of the part in view for one second. |
click | Clicks a link in the part. |
feedback | Rates the answer. |
Each part sends impression and viewable_impression once for each item and
each query.
What a record holds
A click on a search result goes out like this:
{
"type": "click",
"product_ids": ["article-1042"],
"miso_id": "7c8d9e0f-1a2b-…",
"anonymous_id": "5f6a7b8c-9d0e-…",
"context": {
"custom_context": {
"api_group": "ask",
"api_name": "search",
"property": "products",
"question_id": "0e1f2a3b-4c5d-…",
"root_miso_id": "d02603ab-d544-…",
"question_source": "_organic",
"workflow": "hybrid-search"
}
}
}
The fields mean:
| Field | Value |
|---|---|
type | One of the types above. |
product_ids | The product_id of each result, article, image or product the reader acted on. [] for answer. |
miso_id | On products only: the miso_id of the search response the results came from. |
anonymous_id, user_id | The reader, from the client context. |
value, result_type | On feedback only: the rating, and answer. |
context.custom_context.api_group | ask |
context.custom_context.api_name | search |
context.custom_context.workflow | hybrid-search |
context.custom_context.property | One of the properties above. Absent on feedback. |
context.custom_context.items | The link texts the reader acted on, for answer. |
context.custom_context.event_target | citation-link on a citation click. |
context.custom_context.question_id | The question_id of the answer to the query. |
context.custom_context.root_miso_id | The miso_id of the first page of results for the query. On every record, answer parts included. |
context.custom_context.question_source | How the reader asked: _organic for a typed query. |
Send an interaction yourself
Send your own when you render a part of the page with your own code, for
example a list of results you build from the
data event. Hybrid Search cannot
see clicks in markup it did not render.
Turn off the SDK's tracker for that part first, so the same click does not count twice:
client.ui.hybridSearch.useTrackers({ products: { active: false } });
To track every part yourself, turn off all the trackers:
client.ui.hybridSearch.useTrackers(false);
Then call client.api.interactions.upload with the fields above. Pass it the
request and value from the data event of client.ui.hybridSearch you
rendered the list from:
function reportResultClick(client, { request, value }, productId) {
const { metadata = {} } = request.payload;
client.api.interactions.upload({
type: "click",
product_ids: [productId],
miso_id: value.miso_id,
context: {
custom_context: {
api_group: "ask",
api_name: "search",
workflow: "hybrid-search",
property: "products",
question_id: value.question_id,
root_miso_id: value.root_miso_id,
question_source: metadata.question_source,
},
},
});
}
The SDK adds the reader's anonymous_id or user_id and the page URL for
you. Send impression and viewable_impression for the same list too, or
the click-through rate for that part has nothing to divide by.
From a server, or with no SDK on the page, send the same record to
POST /v1/interactions. See the API Reference.
If it does not work
| Symptom | Cause |
|---|---|
| Clicks count twice | The SDK tracker for that part is still on. Turn it off with useTrackers. |
| A part shows clicks but no click-through rate | Only click is sent. Send impression and viewable_impression as well. |
| Nothing reaches Miso and the console warns about a playground app | Miso does not store interactions for a playground app. Use your own app's key. |
Next
- Hybrid Search — Events — the events that carry the response.
- Results and Sources — the elements these interactions come from.
