Google Analytics Integration

Integrating Rooster with Google Analytics just takes a few lines of javascript

Integrating with Universal Analytics

To integrate with the Google's Universal Analytics you just add some event listeners on the _GT object. Generally speaking the important events to listen for are view, interaction, close, and engagement. Whenever one of these events is fired you'll want to fire a UA event showing the activity.

<script>
  function logRoosterOverlayWithGoogleAnalytics(interaction_type, overlay) {
    ga('send',
'event',
'Rooster',
interaction_type, 'overlay' + overlay.id,
interaction_type == 'interaction' || interaction_type == 'engagement'); } // Listen for 'view' message from Rooster _GT.on('view', function(overlay) { logRoosterOverlayWithGoogleAnalytics('view', overlay); }); // Go ahead _GT.on('interaction', function(overlay) { logRoosterOverlayWithGoogleAnalytics('interaction', overlay); }); _GT.on('close', function(overlay) { logRoosterOverlayWithGoogleAnalytics('close', overlay); }); _GT.on('engagement', function(overlay) { logRoosterOverlayWithGoogleAnalytics('engagement', overlay); }); </script>
Have more questions? Submit a request

Comments

Powered by Zendesk