Skip to main content

Kantar Focal Meter integration

This plugin provides integration with Focal Meter by Kantar. Focal Meter is a box that connects directly to the broadband router and collects viewing information for the devices on your network.

This integration enables measuring the audience of content through the Focal Meter router meter. The plugin has the ability to send the domain user ID to a Kantar Focal Meter endpoint. A request is made when the first event with a new user ID is tracked.

note

The plugin is available since version 3.16 of the tracker.

The Focal Meter integration is automatic once configured.

Install plugin

Tracker DistributionIncluded
sp.js
sp.lite.js

Download:

Download from GitHub Releases (Recommended)Github Releases (plugins.umd.zip)
Available on jsDelivrjsDelivr (latest)
Available on unpkgunpkg (latest)

Initialization

To integrate with the Kantar FocalMeter, use the snippet below after setting up your tracker:

window.snowplow(
'addPlugin',
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-focalmeter@latest/dist/index.umd.min.js',
['snowplowFocalMeter', 'FocalMeterPlugin']
);

window.snowplow('enableFocalMeterIntegration', {
kantarEndpoint: '{{kantar_url}}',
useLocalStorage: false // optional, defaults to false
});

Enable integration

The enableFocalMeterIntegration function

The enableFocalMeterIntegration function takes the form:

window.snowplow('enableFocalMeterIntegration', { kantarEndpoint, useLocalStorage? });
ParameterTypeDefaultDescriptionRequired
kantarEndpointstring-URL of the Kantar endpoint to send the requests to (including protocol)Yes
processUserId(userId: string) => string-Callback to process user ID before sending it in a request. This may be used to apply hashing to the value.Yes
useLocalStoragebooleanfalseWhether to store information about the last submitted user ID in local storage to prevent sending it again on next load (defaults not to use local storage)No

Processing the user ID sent in requests to Kantar

By default, the plugin sends the domain user ID as a GET parameter in requests to Kantar without modifying it. In case you want to apply some transformation on the value, such as hashing, you can provide the processUserId callback in the enableFocalMeterIntegration call:

window.snowplow('enableFocalMeterIntegration', {
kantarEndpoint: "https://kantar.example.com",
processUserId: (userId) => md5(userId).toString(), // apply the custom hashing here
});

How does it work?

The plugin inspects the domain user ID property in tracked events. Whenever it changes from the previously recorded value, it makes an HTTP GET requested to the kantarEndpoint URL with the ID as a query parameter.

Optionally, the tracker may store the last published domain user ID value in local storage in order to prevent it from making the same request on the next page load. If local storage is not used, the request is made on each page load.