# @mux/mux-data-google-ima

> Mux Data SDK extension for monitoring Google IMA Ads with mux-embed

Latest version **0.3.19** (published 2026-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mux/mux-data-google-ima
pnpm add @mux/mux-data-google-ima
yarn add @mux/mux-data-google-ima
bun add @mux/mux-data-google-ima
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.19 |
| Published | 2026-10-27 |
| First published | 2024-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 363.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mux, Inc |
| Maintainers | jsanford8, dylanjha, phil-mux, mux-npmjs |
| Keywords | google-ima, csai, video-analytics, mux |

## Links

- npm: https://www.npmjs.com/package/@mux/mux-data-google-ima
- npm.io page: https://npm.io/package/@mux/mux-data-google-ima

## Dependencies (1)

- [mux-embed](https://npm.io/package/mux-embed.md) 5.19.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.3.19 (latest) — 2026-10-27
- 0.3.18 — 2026-10-05
- 0.3.17 — 2026-04-27
- 0.3.16 — 2026-04-10
- 0.3.15 — 2026-02-25
- 0.3.11 — 2026-02-18
- 0.3.4 — 2026-02-03
- 0.3.3 — 2026-01-20
- 0.3.2 — 2025-12-17
- 0.3.1 — 2025-11-19
- 0.3.0 — 2025-10-01
- 0.2.12 — 2025-09-05
- 0.2.11 — 2025-07-10
- 0.2.10 — 2025-07-02
- 0.2.8 — 2025-04-07
- … 12 more at https://npm.io/package/@mux/mux-data-google-ima/versions

## README

<p align="center">
  <a href="https://mux.com/">
    <img src="https://avatars.githubusercontent.com/u/16199997?s=200&v=4" alt="Mux Logo">
  </a>
</p>

# Google IMA Extension to Mux Embed Data SDK for Monitoring Client-Side Ads

![npm (tag)](https://img.shields.io/npm/v/@mux/mux-data-google-ima/latest)
![npm bundle size](https://img.shields.io/bundlephobia/min/@mux/mux-data-google-ima)
![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/@mux/mux-data-google-ima)
![npm](https://img.shields.io/npm/dm/@mux/mux-data-google-ima)
![npm](https://img.shields.io/npm/dt/@mux/mux-data-google-ima)

Mux Data gives you insight into video engagement and Quality of Experience using client-side SDKs for your player.

This Google IMA SDK extension adds monitoring of client-side ads via the [Google IMA HTML5 SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) along with your main content played using
HTML5 Video, HLS.js, or dash.js. See all [supported players here](https://docs.mux.com/guides/data).

# Documentation

## Quick Start

If you're not already familiar with monitoring your media using `mux-embed`, it's recommended you read those docs first:

- [Monitor HTML5 Video Element](https://docs.mux.com/guides/data/monitor-html5-video-element)
- [Monitor HLS.js](https://docs.mux.com/guides/data/monitor-hls-js)
- [Monitor Dash.js](https://docs.mux.com/guides/data/monitor-dash-js)

If you've already used `mux-embed` before, working with the `google-ima` extension will feel fairly familiar.

### Install the google-ima extended `mux-embed`

The `google-ima` package _extends_ `mux-embed` to add Google IMA specific integrations and monitoring, so instead of
installing `mux-embed`, you can simply install `@mux/google-ima`.

**npm:**

```sh
npm install --save @mux/mux-data-google-ima
```

**yarn:**

```sh
yarn add @mux/mux-data-google-ima
```

**cdn:**

```html
<script src="https://src.litix.io/google-ima/0/google-ima-mux.js"></script>
```

### Example HTML5 implementation using HLS.js

```html
<script blocking type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
<script type="text/javascript" src="https://src.litix.io/google-ima/0/google-ima-mux.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<!-- Scrtipt for your Google IMA integration -->
<script type="text/javascript" src="./ads.js"></script>
<div id="videoplayer">
  <video id="content" width="960" height="400"></video>
  <div id="adcontainer"></div>
</div>
<script>
  const player_init_time = mux.utils.now();
  // ... code to setup ima integration
  // For examples, see: https://github.com/googleads/googleads-ima-html5
  const imaAdsLoader = codeToSetupIMAAndGetAdsLoader();

  if (Hls.isSupported()) {
    hls = new Hls({ debug: true });
    hls.loadSource('https://stream.mux.com/a4nOgmxGWg6gULfcBbAa00gXyfcwPnAFldF8RdsNyk8M.m3u8');
    hls.attachMedia(mediaEl);
  }

  // Use mux-embed just like you normally would
  mux.monitor('#content', {
    data: {
      video_title: 'My Video Title',
      player_init_time,
      env_key: 'YOUR_MUX_DATA_ENV_KEY',
    },
    hlsjs: hls,
    // Just pass in your IMA AdsLoader reference, just like Hls.js
    imaAdsLoader,
  });

  // ... code to request ads
  // NOTE: While not necessary, unless you're autoplaying, it's recommended
  // that you don't request ads until after monitoring to get more accurate
  // metrics and not miss events in your view
  requestAds();
</script>
```

---
_Source: https://npm.io/package/@mux/mux-data-google-ima · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
