Skip to main content

Setting up Orion to work with Outbrain

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

  1. Have the module enabled
  2. Update Bootstrap Code
  3. Add Outbrain Event Listeners
  4. Spiny Team Review

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

In order to ensure Outbrain impressions are counted by Spiny please update your bootstrap code in accordance with the following:

  1. Add "handleOutbrainEvent" to the orionMethods array.
<!-- Spiny.ai Orion Bootstrap START --->
<script>
// Add "handleOutbrainEvent" to orionMethods
var orionMethods = ["init","registerPost","report","newPageView","setContext", "handleOutbrainEvent"];
(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);

orion.init(...)

</script>
<!-- Spiny.ai Orion Bootstrap END --->

Outbrain Event Listeners

Setup Outbrain Event listeners:

<script>
window.OBREvents = window.OBREvents || [];

// For each Outbrain Widget
window.OBREvents.push({
name: "rendered",
widgetId: "<OUTBRAIN_WIDGET_ID>",
feedCards: 0,
callback: orion.handleOutbrainEvent,
});
window.OBREvents.push({
name: "viewability",
widgetId: "<OUTBRAIN_WIDGET_ID>",
feedCards: 0,
callback: orion.handleOutbrainEvent,
});
window.OBREvents.push({
name: "click",
widgetId: "<OUTBRAIN_WIDGET_ID>",
feedCards: 0,
callback: orion.handleOutbrainEvent,
});
</script>

This will ensure Orion can properly register events and further listen for viewable impression events for Outbrain ad units.

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.