Enable rich media interaction signals in the Connect web library
You can enable the Connect library to record user interactions with video and audio content on your website. The findings can be valuable for audience segmentation based on product (or product category) interest.
We've added the signal for retailers who get a lot of video reviews from customers, but you can monitor the consumption of your own content in the same way.
Availability
The rich media interaction signal is supported by Premium and Ultimate subscriptions.
Configuration
The Connect library provides a method, TLT.logSignal()
with which to send the signal to the Acoustic Connect endpoint, as a JSON object. The Connect library must be initialized before the method is called.
You can get data for the signal by listening for events in your video player. Most of them offer well-documented APIs.
Required fields
You must populate the mediaId
field before sending the signal. Without this required property, the signal will be ignored.
Field | Values | Definition |
---|---|---|
category | String. Valid value - Behavior . | The category of the signal. Do not edit. |
effect | String. Valid values: - negative - positive | Describes the effect of the signal on engagement. It is intended to be used for engagement index scoring. Usually rich media interactions are interpreted as positive signals. |
mediaId | String | The URL of the media file. You can scrape it from the page source or query the video player API. |
name | String, up to 256 characters | Assign a name to the signal to differentiate it from other signals. |
signalType | String. Valid value -richMediaInteraction . | The type of signal to enable. Do not edit. |
Optional fields
Field | Values | Definition |
---|---|---|
interactionType | String. Valid values: - load - launch - pause - continue - complete - stop - enlarge | The type of user interaction with the media |
mediaCategory | String | The category that the media falls into, for example, "video" |
mediaName | String | The title of the audio or video file |
signalCustomAttributes | Array of objects | Allows for additional custom attributes. For each custom attribute, add an object with two string fields:name and value . |
url | String | The URL of the page where the media file is embedded |
Example
// Check that the Connect SDK is present and videojs API is available
// See videojs player API documentation: https://docs.videojs.com/
// Other video players will have their own APIs, adjust code as needed.
if (window.TLT && window.TLT.isInitialized() && typeof window.videojs === "function") {
const signal = {
signalType: "richMediaInteraction",
name: "richMediaInteraction generated by web site",
category: "Behavior",
mediaId: "", // Required
url: "", // Required
mediaCategory: "", // Required
mediaName: "", // Required
interactionType: "", // Required
effect: "positive", // Required, must be "positive" or "negative"
signalCustomAttributes: []
};
function sendRichMediaInteractionSignal(mediaId, mediaName, interactionType) {
signal.mediaId = mediaId;
signal.url = window.location.href;
signal.mediaCategory = "Video";
signal.mediaName = mediaName;
signal.interactionType = interactionType;
TLT.logSignal(signal);
}
window.videojs("example_video").ready(function () {
const player = this;
const mediaId = player.cache_.src;
const mediaName = mediaId.substring(mediaId.lastIndexOf("/") + 1);
player.on("play", sendRichMediaInteractionSignal(mediaId, mediaName, "continue"));
player.on("pause", sendRichMediaInteractionSignal(mediaId, mediaName, "pause"));
player.on("ended", sendRichMediaInteractionSignal(mediaId, mediaName, "complete"));
}());
}
Updated 11 days ago