
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
@mux/mux-data-google-ima
Advanced tools
Mux Data SDK extension for monitoring Google IMA Ads with mux-embed
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 along with your main content played using HTML5 Video, HLS.js, or dash.js. See all supported players here.
If you're not already familiar with monitoring your media using mux-embed, it's recommended you read those docs first:
If you've already used mux-embed before, working with the google-ima extension will feel fairly familiar.
mux-embedThe 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:
npm install --save @mux/mux-data-google-ima
yarn:
yarn add @mux/mux-data-google-ima
cdn:
<script src="https://src.litix.io/google-ima/0/google-ima-mux.js"></script>
<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>
FAQs
Mux Data SDK extension for monitoring Google IMA Ads with mux-embed
The npm package @mux/mux-data-google-ima receives a total of 829,541 weekly downloads. As such, @mux/mux-data-google-ima popularity was classified as popular.
We found that @mux/mux-data-google-ima demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.