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:

PropertyElementTypesSubject
related_questions<miso-related-questions>impression, viewable_impression, clickitems, the question texts
container<miso-explore>impression, viewable_impressionThe unit itself
query<miso-query>submitvalue, 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:

TypeThe reader
impressionHas the part on the page, seen or not.
viewable_impressionHas at least half of the part in view for one second.
clickClicks a question.
submitSends 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:

FieldValue
typeOne of the types above.
product_ids[]. The questions are text.
miso_idThe miso_id of the response the questions came from.
anonymous_id, user_idThe reader, from the client context.
context.custom_context.api_groupask
context.custom_context.api_namerelated_questions, or trending_questions for trending questions.
context.custom_context.workflowexplore
context.custom_context.propertyOne of the properties above.
context.custom_context.itemsThe question texts the reader acted on, for related_questions.
context.custom_context.valueOn submit only: the text the reader typed.
context.custom_context.unit_idThe 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

SymptomCause
Clicks count twiceThe SDK tracker for that part is still on. Turn it off with useTrackers.
The questions show clicks but no click-through rateOnly click is sent. Send impression and viewable_impression as well.
Two units on a page share one set of numbersBoth use the default unit. Give each <miso-explore> its own unit-id.
Nothing reaches Miso and the console warns about a playground appMiso does not store interactions for a playground app. Use your own app's key.

Next