
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
@turbo-player/integration-analytics
Advanced tools
A unified analytics integration package for the turbo player. This package provides adapters for various analytics providers including NPAW/Youbora, Comscore, Nielsen, and Sensic.
npm install @turbo-player/integration-analytics
NPAW analytics integration for video analytics and quality of experience monitoring.
import { connectToNpaw } from '@turbo-player/integration-analytics/npaw';
const integration = document.querySelector('my-integration');
// Simple setup for NPAW analytics (that also handles consent)
const { npawPlugin, destroy } = connectToNpaw(integration, {
accountCode: 'your-npaw-account-code'
});
import { connectToNpaw } from '@turbo-player/integration-analytics/npaw';
const { npawPlugin, destroy } = connectToNpaw(integration, {
accountCode: 'your-npaw-account-code',
appName: 'my-app',
appVersion: '1.0.0'
});
npawPlugin.setAnalyticsOptions({
userId: 'my-user-id',
'content.customDimensions': {
tenant: 'my-tenant'
}
});
// Clean up when done
destroy();
import { NpawTurboPlayerAdapter } from '@turbo-player/integration-analytics/npaw';
import NpawPlugin from 'npaw-plugin';
const npawPlugin = new NpawPlugin('your-npaw-account-code');
npawPlugin.registerAdapterFromClass(integration, NpawTurboPlayerAdapter);
Comscore Streaming Analytics integration for measuring streaming video consumption.
import { connectToComscore } from '@turbo-player/integration-analytics/comscore';
const integration = document.querySelector('my-integration');
// Connect Comscore analytics
const disconnect = connectToComscore(integration, {
publisherId: 'your-publisher-id',
publisherName: 'Your Publisher Name'
});
// Clean up when done
disconnect();
| Option | Type | Required | Description |
|---|---|---|---|
publisherId | string | Yes | Your Comscore publisher ID |
publisherName | string | Yes | Your publisher name (e.g., "Joyn") |
debug | boolean | No | Enable debug mode for implementation validation |
warnCallback | (error: Error) => void | No | Custom callback for warning messages |
configureContentMetadata | (metadata) => metadata | null | No | Customize content metadata before tracking |
import { connectToComscore } from '@turbo-player/integration-analytics/comscore';
const disconnect = connectToComscore(integration, {
publisherId: 'your-publisher-id',
publisherName: 'Your Publisher Name',
debug: true,
warnCallback: (error) => {
console.warn('Comscore warning:', error.message);
},
configureContentMetadata: (metadata) => {
// Customize metadata or return null to skip tracking
metadata.setGenreName('Sports');
return metadata;
}
});
Comscore tracking only occurs when the user has given consent according to IAB TCF:
Nielsen Digital Content Ratings integration for streaming measurement.
import { connectToNielsen } from '@turbo-player/integration-analytics/nielsen';
const integration = document.querySelector('my-integration');
// Connect Nielsen analytics
const disconnect = connectToNielsen(integration, {
appId: 'your-app-id',
country: 'de'
});
// Clean up when done
disconnect();
| Option | Type | Required | Description |
|---|---|---|---|
appId | string | Yes | Nielsen App ID (starts with 'P' for production, 'T' for test) |
country | string | Yes | Two-letter country code for country-specific metadata mapping (e.g., 'de' for Germany) |
debug | boolean | No | Enable Nielsen SDK debug mode |
warnCallback | (error: Error) => void | No | Custom callback for warning messages |
configureContentMetadata | (metadata) => metadata | null | No | Extend/modify content metadata for tracking |
configureAdMetadata | (metadata) => metadata | No | Extend/modify ad metadata for tracking |
Nielsen uses country-specific metadata mappings:
'de' - Germany (uses AGF-specific custom variables)assetid, type, program, title, length for content; assetid, type for ads)For Germany (country: 'de'), the following metadata is automatically built:
assetid, program, title, length, nol_c0 (part number), nol_c2 (web only flag), nol_c5 (page URL), nol_c7 (video ID), nol_c9 (video title), nol_c10 (publisher), nol_c12 (video type), nol_c15 (format ID), nol_c18 (livestream flag)assetid, type, length, title, nol_c1 (universal ad ID), nol_c2, nol_c4 (ad form), nol_c10, nol_c11 (ad ID), nol_c12, nol_c17 (placement type), nol_c18For unsupported country codes, only base metadata is provided. Use configureContentMetadata and configureAdMetadata to add country-specific fields manually:
const disconnect = connectToNielsen(integration, {
appId: 'your-app-id',
country: 'fr', // No built-in mapping for France
configureContentMetadata: (baseMetadata) => {
// baseMetadata contains: assetid, type, program, title, length
return {
...baseMetadata,
program: integration.content?.show?.name ?? '',
// Add France-specific fields as needed
};
},
configureAdMetadata: (baseMetadata) => {
// baseMetadata contains: assetid, type
return {
...baseMetadata,
title: integration.currentAd?.title ?? ''
};
}
});
The configureContentMetadata and configureAdMetadata callbacks receive country-specific metadata that is automatically built from integration data. You can extend or modify this metadata:
import { connectToNielsen } from '@turbo-player/integration-analytics/nielsen';
const disconnect = connectToNielsen(integration, {
appId: 'your-app-id',
country: 'de',
debug: true,
warnCallback: (error) => {
console.warn('Nielsen warning:', error.message);
},
configureContentMetadata: (metadata) => {
// metadata contains country-specific fields (e.g., AGF fields for 'de')
// Return null to skip tracking this content
if (!integration.content) return null;
return {
...metadata,
// Add custom fields or override existing ones
subbrand: 'abc' // VCID provided by Nielsen
};
},
configureAdMetadata: (metadata) => {
// metadata contains country-specific ad fields
return {
...metadata,
subbrand: 'abc'
};
}
});
Nielsen does not require consent checks and uses a synchronous stub pattern. Events are queued until the SDK loads from CDN.
Sensic (formerly GfK) integration for streaming measurement in Germany and Austria.
import { connectToSensic } from '@turbo-player/integration-analytics/sensic';
const integration = document.querySelector('my-integration');
// Connect Sensic analytics
const disconnect = connectToSensic(integration, {
media: 'your-media-id',
platform: 'web',
country: 'de'
});
// Clean up when done
disconnect();
| Option | Type | Required | Description |
|---|---|---|---|
media | string | Yes | Sensic media identifier |
platform | 'web' | 'tv' | Yes | Platform type |
country | string | Yes | Two-letter country code (e.g., 'de', 'at') |
warnCallback | (error: Error) => void | No | Custom callback for warning messages |
buildCustomParams | (customParams) => Record<string, string> | null | No | Extend/modify custom parameters for tracking |
buildStreamId | (streamId) => string | No | Extend/modify stream ID for tracking |
The buildCustomParams and buildStreamId callbacks receive country-specific values as input and are called on each stream start (VoD content, live content, and linear ads). Use integration.content for content data or integration.currentAd for ad data:
import { connectToSensic } from '@turbo-player/integration-analytics/sensic';
const disconnect = connectToSensic(integration, {
media: 'your-media-id',
platform: 'web',
country: 'at',
warnCallback: (error) => {
console.warn('Sensic warning:', error.message);
},
buildCustomParams: (customParams) => {
// customParams contains country-specific params (e.g., AT params for Austria)
// Return null to skip tracking this stream
return {
...customParams,
genre: integration.content?.genre ?? '',
showId: integration.content?.show?.id ?? ''
};
},
buildStreamId: (streamId) => {
// streamId contains country-specific stream ID
return streamId || integration.content?.id ?? '';
}
});
Sensic tracking only occurs when the user has given consent according to IAB TCF:
Sensic loads country-specific measurement scripts:
'de' - Germany (https://de-config.sensic.net/s2s-web.js)'at' - Austria (https://at-config.sensic.net/s2s-web.js)For TV platforms, the CTV variant is loaded automatically (e.g., https://de-config.sensic.net/ctv/s2s-web.js).
FAQs
Analytics integrations for the turbo player
We found that @turbo-player/integration-analytics 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.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.