How to track video events on article pages?
The smartocto JavaScript tracker supports video event tracking. If you have already embedded the real-time tracking script into your website, a video track function is available to be attached to play event listeners to each video.
The smartocto Tentacles script must be loaded on the page in order to support video tracking.
Video meta-data properties:
Name | Required | Description | Type |
brandId | No | brand ID, provided by the Support team | string |
videoId | Yes | Unique identifier of the video | string |
title | Yes | Title of the video | string |
pubDate | Yes | Published date and time of the video | string |
uri | No | The full url of the video | string |
channel | No | The platform (web, android or ios or app). When empty the default value is 'web' | string |
Example code: video view in website
This is the example code block that you should modify to enable video events tracking:
var player = your_video_player_instance;
player.on('play', function() {
window.tentacles.onVideoPlay(
{
brandId: '',
videoId: 'video-ID',
title: 'Video Title',
pubDate: '2022-12-31T23:59:59+00:00',
uri: 'https://yourdomain.com/video-url'
channel: 'web'
}
);
});
Example code: video view in Android app
This is the example code block that you should modify to enable video events tracking:
var player = your_video_player_instance;
player.on('play', function() {
window.tentacles.onVideoPlay(
{
brandId: '',
videoId: 'video-ID',
title: 'Video Title',
pubDate: '2022-12-31T23:59:59+00:00',
channel: 'android'
}
);
});
Please note that automatically discovering videos on the page is not supported in this version.
If you have any questions or concerns, please contact our Support Team: support@smartocto.com