Explore — Interactions
See what the Explore workflow reports to Miso as a reader sees and opens the questions, and send the same records yourself when you render them on your own.
Each record is an interaction: a reader saw, scrolled to, clicked or submitted something. Miso builds the Explore metrics in Dojo from them. Below we list the interactions Explore sends, the fields Miso needs on each one, and then send one by hand.
You need a working Explore page first. See Explore — Quick Start.
What Explore sends
The SDK watches each part of the unit and sends an interaction when the
reader acts on it. property names the part:
| Property | Element | Types | Subject |
|---|---|---|---|
related_questions | <miso-related-questions> | impression, viewable_impression, click | items, the question texts |
container | <miso-explore> | impression, viewable_impression | The unit itself |
query | <miso-query> | submit | value, the text the reader typed |
container is tracked whether or not the unit has questions to show. The
unit still has a record on a new article with no questions yet, or on a page
with only the query box. Dojo divides query submits by container
impressions to get the submit rate.
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 question. |
submit | Sends a question from the query box. |
Each part sends impression and viewable_impression once for each page
load.
What a record holds
A click on a related question goes out like this:
{
"type": "click",
"product_ids": [],
"miso_id": "d02603ab-d544-…",
"anonymous_id": "5f6a7b8c-9d0e-…",
"context": {
"custom_context": {
"api_group": "ask",
"api_name": "related_questions",
"property": "related_questions",
"items": ["How do rate cuts affect mortgages?"],
"unit_id": "default",
"workflow": "explore"
}
}
}
The fields mean:
| Field | Value |
|---|---|
type | One of the types above. |
product_ids | []. The questions are text. |
miso_id | The miso_id of the response the questions came from. |
anonymous_id, user_id | The reader, from the client context. |
context.custom_context.api_group | ask |
context.custom_context.api_name | related_questions, or trending_questions for trending questions. |
context.custom_context.workflow | explore |
context.custom_context.property | One of the properties above. |
context.custom_context.items | The question texts the reader acted on, for related_questions. |
context.custom_context.value | On submit only: the text the reader typed. |
context.custom_context.unit_id | The unit, from the unit-id attribute of <miso-explore>. default on a page with one unit. |
Send an interaction yourself
Send your own when you render the questions with your own code, for example
a list you build from the data event.
Explore 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.explore.useTrackers({ related_questions: { active: false } });
To track every part yourself, turn off all the trackers:
client.ui.explore.useTrackers(false);
Then call client.api.interactions.upload with the fields above. Pass it the
value from the data event you rendered the list from:
function reportQuestionClick(client, value, question) {
const workflow = client.ui.explore;
client.api.interactions.upload({
type: "click",
product_ids: [],
miso_id: value.miso_id,
context: {
custom_context: {
api_group: "ask",
api_name: "related_questions",
workflow: "explore",
property: "related_questions",
items: [question],
unit_id: workflow.id,
},
},
});
}
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 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. |
| The questions show clicks but no click-through rate | Only click is sent. Send impression and viewable_impression as well. |
| Two units on a page share one set of numbers | Both use the default unit. Give each <miso-explore> its own unit-id. |
| 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
- Explore — Events — the events that carry the response.
- Answer Metrics — the reports Miso builds from these interactions.
