Datazoom is a high-availability real-time data collection solution. This document summarizes how to integrate your Chromecast Receiver with the Datazoom platform.
Login to Datazoom here: https://app.datazoom.io
Add a Collector as indicated here: How to add a Collector
CONFIG ID to be used in the subsequent steps
Datazoom provides plugins for data collection through our Beacon Services. Integrate the Chromecast receiver plugin into your Chromecast web receiver application with the following snippet:
Insert this JS line into your HTML
CONFIG_IDvalue with the collector configuration ID.
This inserts Datazoom's data collection SDK into the page.
Activate Data Collection for a Chromecast Receiver
To activate data collection for the Chromecast receiver instance, create a Datazoom context which references the playerManager instance with the following snippet:
Enable Ad Data Collection (Google IMA)
To enable a Chromecast collector to capture the ad related data points, the required steps for a web application differ depending on how the IMA ad framework is integrated with the chromecast player. In general, there are two types of integration method between the chromecast player and ad framework:
1. Ad framework integration supported by the chromecast player (Native IMA)
Chromecast player support IMA ad integration as a part or an optional module of the player. Since the corresponding Datazoom collector for the player is prebuilt with knowledge of the player’s ad related features, for a web application who simply leverages the video player for ads, no additional code is required to enable ad data collection in this scenario.
2. Ad integration external to the chromecast player (Direct IMA)
For a web application who likes to enable IMA ads independent of the chromecast player, it can choose to utilize the IMA ad framework library directly. Since it is impossible for the corresponding Datazoom collector to gather ad information through the chromecast player, some provisioning steps will be required to enable ad data collection.
For a Datazoom collector to gather ad information in this scenario, the application should give access by attaching these IMA objects to the collector context as soon as they become available. The Datazoom collector context interface expose these methods for this purpose:
Direct IMA Integration Methods
Direct IMA integration can be done in different ways. See below.
1. Pause-Resume Method
This implementation pauses the content when the ad starts and resume the content when ad completes. To enable ad data collection in this scenario, some provisioning steps will be required.
The below code snippet helps to pause content when ad starts and resume content when ad ends.
That’s it. The Datazoom collector is now provided with the required access to gather ad related information with pause-resume method.
2. Stop-Load Method
This implementation stops the content when the ad starts and loads the content when ad completes.
Currently Chromecast collector don’t support this type of implementation.
NPM (Node Package Manager)
We have made it convenient to manage your Chromecast Collector integration by providing NPM (Node Package Manager) support. Please see installation details here.
Chromecast Web Receiver API : https://developers.google.com/cast/docs/reference/web_receiver