mirror of
https://github.com/videojs/video.js.git
synced 2026-11-20 06:29:27 +01:00
Co-authored-by: videojs-release[bot] <324600730+videojs-release[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@videojs/google-analytics
Google Analytics 4 (GA4) telemetry integration for Video.js. It monitors media playback and user interactions, automatically dispatching standard GA4 Enhanced Measurement video events and Video.js interaction events to window.dataLayer (or window.gtag).
It is an extension: it adds behavior to whichever media the player is playing.
pnpm add @videojs/html @videojs/google-analytics
# or
pnpm add @videojs/react @videojs/google-analytics
Usage
import '@videojs/html/extensions/google-analytics';
import { GoogleAnalytics } from '@videojs/react/extensions/google-analytics';