Skip to main content

Player metrics

The below events are emitted by the Lora Live Shopping player for the purpose of reporting metrics.

Listening to events​

By registering an event listener on the top window of the page that you have the player embedded in, all player events/user interactions will be dispatched under lora-stream-tracking event name.

  window.addEventListener('lora-stream-tracking', ({detail}) => {
console.log(detail.event); // e.g. "on-load"
console.log(detail.data); // example output shown below
});

Example output : Full sample data of like interaction payload

{
show_id: "SHOW_ID",
org_id: "ORGANIZATION_ID",
stream_id: "STREAM_ID",
title: "THE SHOW TITLE",
timeline: {
is_live: true,
relative_time: 52.4212,
},
interaction_type: "like",
count: 1,
}

Events​

on-load​

Emitted when the live stream is loaded.

{
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
}

on-pending​

Emitted when the live stream is upcoming.

{
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
}

on-play​

Emitted when the live stream is playing.

{
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
is_live: true,
is_muted: true
}

on-stop​

Emitted when the live stream is ended.

{
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
is_live: false,
}

Interactions​

Mute the player​

User mutes the player.

{
interaction_type: "muted",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Unmute the player​

User unmutes the player.

{
interaction_type: "unmuted",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Pause a show​

User pauses video.

{
interaction_type: "pause",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Resume a show​

User restarts video after having paused it.

{
interaction_type: "resume",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Like​

User taps send a heart. If the user rapidly likes multiple times, a single event may be sent with the number of likes described by the property count in the event data.

{
interaction_type: "like",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
count: 5
}

Share​

User clicks/taps on the share button/icon.

{
interaction_type: "share",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Send chat message​

User sends a chat message (does not contain the actual message)

{
interaction_type: "send-message",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Close the player​

User closes the player

{
interaction_type: "close-the-player",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Minimize the player​

Player gets minimized

{
interaction_type: "minimize",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Maximize the player​

Player gets maximized from the minimized position

{
interaction_type: "maximize",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Show product list​

User opens the products list

{
interaction_type: "show-product-list",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Hide product list​

User hides the products list

{
interaction_type: "hide-product-list",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Product click​

User clicks on the products

  • interaction_type: {action-origin}:{product-display-target}

action-origin

Action-origin is the place of the player from where the user click the product:

  • product-list
  • product-feature

product-display-target

Product-display-target is an action that happens when the user clicks a product. Based on the player setup, different types may get emitted

  • show-product-detail-in-new-tab (Default)
  • show-product-detail-in-player (Requires cart integration)
  • show-product-detail-behind-player (Requires Miniplayer)
{
interaction_type: "product-list:show-product-detail-in-new-tab",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
id: "PRODUCT_ID",
name: "PRODUCT_NAME",
sku: "PRODUCT_SKU"
}

Add to cart​

User clicks the add-to-cart button Only available if you have cart integration

{
interaction_type: "add-to-cart",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
items: [
{
id: "PRODUCT_ID",
name: "PRODUCT_NAME",
quantity: 1,
current_price: 120,
original_price: 220,
sku: "PRODUCT_SKU",
},
]
}

Checkout​

User clicks the checkout button

{
interaction_type: "checkout",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
items: [
{
id: "PRODUCT_ID",
name: "PRODUCT_NAME",
quantity: 1,
price: 120,
sku: "PRODUCT_SKU",
},
],
order_value: 120
}

Show Cart​

User opens the player cart by clicking on the cart icon.

{
interaction_type: "show-cart",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Hide Cart​

User hides the player cart

{
interaction_type: "hide-cart",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
}

Open Poll​

The poll has popped up

{
interaction_type: "open-poll",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
poll_id: "POLL_ID",
}

Poll Vote​

User voted in a poll.

{
interaction_type: "poll-vote",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
poll_id: "POLL_ID",
}

Close Poll​

User closed the poll modal

{
interaction_type: "close-poll",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
poll_id: "POLL_ID",
}

Open Quiz​

The quiz has popped up

{
interaction_type: "open-quiz",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
quiz_id: "QUIZ_ID",
}

Quiz Answer​

User submits an answer.

{
interaction_type: "quiz-answer",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
quiz_id: "QUIZ_ID",
}

Close Quiz​

User closed the quiz modal

{
interaction_type: "close-poll",
show_id: "SHOW_ID",
stream_id: "STREAM_ID",
org_id: "ORGANIZATION_ID",
title: "THE SHOW TITLE",
timeline: {...},
quiz_id: "QUIZ_ID",
}

Timeline​

Live​

timeline: {
is_live: true,
relative_time: 52.033333, // Current watched time of the current stream in seconds
}

Archived​

timeline: {
is_live: false,
relative_time: 52.033333, // Current watched time of the current stream in seconds
show_length: 3600, // Total length of the show in seconds
}