Datazoom is a high-availability real-time data collection solution. This document summarizes how to integrate your Chromecast Receiver with the Datazoom platform.
Data collected by our Chromecast Collector will appear in its own app session. For example, if you are viewing video on a web browser configured with one of our javascript Collectors and you then cast to a Chromecast web receiver that is instrumented with our Chromecast Collector, data from that viewer will be split into two app sessions, one from the web browser and one from the web receiver.
Login to Datazoom here: https://app.datazoom.io
Add a Collector as indicated here: How to add a Collector
Copy the CONFIG ID
to be used in the subsequent steps
Plugin Integration
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:
<script src='https://platform.datazoom.io/beacon/v1/config?configuration_id=CONFIG_ID'></script>
Insert this JS line into your HTML
Replace the
CONFIG_ID
value 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:
var datazoom_context = datazoom.createContext(playerManager);
For example:
<html> <head> <script type="text/javascript" src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script> <script src='https://platform.datazoom.io/beacon/v1/config?configuration_id=CONFIG_ID'></script> </head> <body> <cast-media-player></cast-media-player> <script> const context = cast.framework.CastReceiverContext.getInstance(); context.start(); const playerManager = context.getPlayerManager(); //Activates Data Collection let datazoom_context = datazoom.createContext(playerManager); </script> </body> </html>
References:
Chromecast Web Receiver API : https://developers.google.com/cast/docs/reference/web_receiver
Comments
0 comments
Article is closed for comments.