Interactive video events
When a WeVideo interactive video is embedded on your site in an iframe, the player posts events to the embedding page using window.postMessage. You can use these to track viewer engagement — for example sending responses to your analytics or CRM. A typical embed URL would be an anonymous assignment link, for example https://www.wevideo.com/api/5/bulbs/assignment/123/go
Listening for events
Each message is a JSON string with a type and a data object:
window.addEventListener("message", (event) => {
if (event.origin !== "https://www.wevideo.com") return; // ignore other senders
let message;
try {
message = JSON.parse(event.data);
} catch {
return; // not a WeVideo event
}
switch (message.type) {
case "interactive_video_started":
console.log("Viewer started the video", message.data);
break;
case "interactive_video_interaction_completed":
console.log("Viewer answered an interaction", message.data);
break;
case "interactive_video_completed":
console.log("Viewer completed the video", message.data);
break;
}
});
Events
interactive_video_started
Sent once per page load, when playback first starts.
| Field | Type | Description |
|---|---|---|
interactiveVideoId | number | ID of the interactive video |
title | string | Title of the interactive video |
userId | number | Viewer's WeVideo user ID |
firstName | string | Viewer's first name |
lastName | string | Viewer's last name |
attemptId | number | null | ID of the viewing attempt |
interactive_video_interaction_completed
Sent every time the viewer submits a response to an interaction (question, poll, etc.).
| Field | Type | Description |
|---|---|---|
interactiveVideoId | number | ID of the interactive video |
userId | number | Viewer's WeVideo user ID |
attemptId | number | null | ID of the viewing attempt |
interactionId | number | ID of the interaction that was answered |
interactionType | string | Interaction type, e.g. multiple_choice, check_all_apply, free_response, poll_q, short_answer |
correct | boolean | null | Whether the response was correct; null for ungraded types like polls |
response.text | string | null | The submitted response text, when the interaction has a text response |
response.interactionOptionIds | string[] | null | IDs of the selected answer options, when the interaction has options |
interactive_video_completed
Sent when the viewer completes the interactive video. Sent at most once per attempt — a retake (new attempt) can produce another one.
| Field | Type | Description |
|---|---|---|
interactiveVideoId | number | ID of the interactive video |
title | string | Title of the interactive video |
userId | number | Viewer's WeVideo user ID |
attemptId | number | null | ID of the viewing attempt |
assignmentId | number | null | Assignment ID, when viewed as part of an assignment |
status | string | Always "completed" |
pointsEarned | number | null | Points the viewer earned across graded interactions |
pointsAvailable | number | null | Total points available in the video |
interactive_video_incomplete
Sent when the viewer reaches the end of the video without meeting the completion criteria (for example a required score threshold). Same payload as interactive_video_completed, with status set to "incomplete".