Setting up Orion to work with EX.CO
Below you will find the steps in order of how they should be completed with links to the sections below going into more detail.
Steps
Have the module enabled
Please let the Spiny team know before proceeding so we can enable this integration's module for your bundle. Once enabled you can proceed with this integration.
Update Bootstrap Code
The "message"
event listener only needs to be setup once per page. If you've implemented the below event listener for another integration you do not need to take any additional steps for this integration.
EX.CO's video player sends all player events as message events so in order to integrate Orion with EX.CO please update your Orion bootstrap code in accordance with the following:
- Add
"trackMessageEvent"
to theorionMethods
array. - Add the
message
event listener shown in the code snippet below(only needs to be implemented once per page not per integration)
<!-- Spiny.ai Orion Bootstrap START --->
<script>
// Add "trackMessageEvent" to orionMethods
var orionMethods = ["init","registerPost","report","newPageView","setContext", "trackMessageEvent"];
(function(s,p,i,n,y){s[i]=s[i]||{queue:[]};for(var x=0;x<n.length;x++){(function(m){s[i][m]=s[i][m]||function(){var a=arguments;s[i].queue.push(function(){s[i][m].apply(s[i],a)})}})(n[x])}if(y){var e=p.createElement("script");e.type="text/javascript";e.async=true;e.src=y;var f=p.getElementsByTagName("script")[0];if(f){f.parentNode.insertBefore(e,f)}else{var d=p.getElementsByTagName("head")[0];if(d){d.appendChild(e)}}}})(window,document,"orion",orionMethods,null);
// Add this message event listener
window.addEventListener("message", orion.trackMessageEvent);
orion.init(...)
</script>
<!-- Spiny.ai Orion Bootstrap END --->
This will allow Orion to register your player instances and perform all necessary reporting.
Spiny Team Review
Once completed please add these changes to a staging site for our team to confirm and once approved please deploy the changes to your production environments.