Skip navigation

Google Analytics

Updated: 12.08.2026
Open as Markdown
This integration has @beta status. Follow the player changelog .

The player can send viewing events to Google Analytics 4. Choose how you connect analytics to your site:

MethodBest for
Google TagYou connect gtag directly to your pages
Google Tag ManagerYou already use GTM

Setup overview

  1. Connect Google Tag or GTM to your site.
  2. If the player runs in an <iframe> through simple embedding or the IFrame API , add the integration script .
  3. Create custom dimensions in GA4 to filter reports by video.

Integration script for iframe

Player events occur inside the iframe. Add this script so the page can receive them:

https://player.kinescope.io/latest/iframe.ga.js

Place the script after Google Tag or GTM. Without it, iframe events do not reach analytics.

Google Tag

<!-- 1. Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || []
  function gtag() {
    dataLayer.push(arguments)
  }
  gtag('js', new Date())
  gtag('config', 'G-XXXXXXXXXX')
</script>

<!-- 2. Integration script after Google Tag. Required when the player is in an iframe -->
<script src="https://player.kinescope.io/latest/iframe.ga.js"></script>

Replace G-XXXXXXXXXX with your GA4 data stream ID.

Google Tag Manager

  1. Download the configuration file .
  2. Import the file into GTM. Select Merge to keep your current container.
  3. In the GA4 – Event – Kinescope Video tag, enter the data stream ID (G-…) used in Google Analytics.
  4. Publish the container.
  5. Add custom definitions in Google Analytics.

The file includes the GA4 – Event – Kinescope Video tag. It sends player actions such as Play and Ended with video parameters .

Page code example

<!-- 1. Google Tag Manager -->
<script>
  ;(function (w, d, s, l, i) {
    w[l] = w[l] || []
    w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
    var f = d.getElementsByTagName(s)[0],
      j = d.createElement(s),
      dl = l != 'dataLayer' ? '&l=' + l : ''
    j.async = true
    j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl
    f.parentNode.insertBefore(j, f)
  })(window, document, 'script', 'dataLayer', 'GTM-XXXXXXX')
</script>

<!-- 2. Integration script after GTM. Required when the player is in an iframe -->
<script src="https://player.kinescope.io/latest/iframe.ga.js"></script>

Replace GTM-XXXXXXX with your container ID. You do not need a separate gtag if GTM already sends data to GA4, as in the imported file.

Copy the snippet for users without JavaScript from Tag Manager. Paste it at the beginning of <body>.

Events sent to GA4

The player sends these events by default:

EventWhen it fires
PlayPlayback starts
EndedPlayback reaches the end

If settings.googleAnalytics.trigger contains progress points, the player also sends events such as:

EventWhen it fires
10 Percent Played, 25 Percent Played, …The viewer reaches N percent
60 Seconds Played, 120 Seconds Played, …The viewer reaches N seconds

Example with the IFrame API :

playerFactory.create('player', {
  url: 'https://kinescope.io/VIDEO_ID',
  settings: {
    googleAnalytics: {
      // Optional if the page already provides the measurement ID through gtag or GTM
      // measurementId: 'G-XXXXXXXXXX',
      trigger: {
        percentages: [10, 25, 50, 75, 95], // → 10 Percent Played, 25 Percent Played, …
        timePoints: [60, 120, 300, 600], // → 60 Seconds Played, 120 Seconds Played, …
      },
    },
  },
})

You can set only percentages, only timePoints, or both arrays. Without trigger, the player sends only Play and Ended.

Event parameters:

ParameterValue
video_idKinescope video ID
video_titleVideo title
video_urlVideo URL
video_durationDuration in seconds
video_percentViewing progress as a percentage
video_current_timeCurrent position in seconds
video_seconds_playedNumber of seconds actually watched
event_categoryAlways Video
external_idExternal ID, if set with externalid or externalId

Custom definitions in GA4

Create custom dimensions to filter reports by video.

In the Event parameter field, enter the technical name from the table, such as video_id. Do not enter a label such as “Video ID.”
  1. In Google Analytics, go to AdminCustom definitions.
  2. Create event-scoped dimensions:
Dimension nameEvent parameter
Video IDvideo_id
Video Titlevideo_title
Video URLvideo_url
External IDexternal_id

Add numeric parameters such as video_duration and video_percent when needed.

Next steps