Yandex Metrica
This integration has
@beta status. Follow the player changelog.The player can send viewing events to Yandex Metrica. Create a goal in your counter and pass the counter ID to the player settings through the IFrame API.
Configure a goal in Metrica
Add a goal in the counter settings:
| Field | Value |
|---|---|
| Name | Any clear name |
| Condition type | JavaScript event |
| Goal ID | Exactly kinescope.video_event |
Enable the integration in the player
Pass the counter ID in settings.yandexMetrics when you call create():
playerFactory.create('player', {
url: 'https://kinescope.io/VIDEO_ID',
settings: { yandexMetrics: '000000000' },
})
Integration script for iframe
A player created through the IFrame API runs in an <iframe>. Add this script to the page:
https://
Place the script after the Yandex Metrica code. Without it, iframe events do not reach Metrica.
IFrame API example
<html>
<head>
<!-- 1. Yandex Metrica -->
<script>
// Yandex Metrica initialization code
</script>
<!-- 2. Integration script after Metrica -->
<script src="https://player.kinescope.io/latest/iframe.ym.js"></script>
<!-- 3. IFrame API -->
<script>
function onKinescopeIframeAPIReady(playerFactory) {
playerFactory.create('player', {
url: 'https://kinescope.io/VIDEO_ID',
settings: { yandexMetrics: '000000000' },
})
}
</script>
<script async src="https://player.kinescope.io/latest/iframe.player.js"></script>
</head>
<body>
<div id="player"></div>
</body>
</html>
Next steps
- Google Analytics — send player events to GA4 and GTM
- Create a player — configure the
settingsparameter