Skip to Content
The new glomex player is released! 🎉View upgrade guide
PublisherPlayerEmbed CodeAdvancedAd-Server

Ad-Server Integration

The glomex Video Player can be seamlessly integrated through your ad-server using script.js. This approach allows you to deliver video content through your existing ad infrastructure.

⚠️

For proper integration, the script must be placed in a friendly iframe. If you’re using Google Ad Manager, ensure that Serve in SafeFrame  is set to Off.

Basic Integration

For a standard integration, use the following creative code. Replace REPLACE_WITH_INTEGRATION_ID with your glomex integration ID:

<script src="https://player.glomex.com/integration/1/script.js?integrationId=REPLACE_WITH_INTEGRATION_ID"></script>

Integration with Passback

For scenarios where you need a fallback option when no ad is available, extend the basic integration with a passback function:

<script> window.glomexPassback = function() { console.log('Passback received'); // Your fallback logic goes here when no ad is available }; </script> <script src="https://player.glomex.com/integration/1/script.js?integrationId=REPLACE_WITH_INTEGRATION_ID&onPassback=glomexPassback"></script>
đź’ˇ

When an onPassback function is defined, the player will only be displayed when an ad is available. If no ad is available, the player will be removed and your specified passback function will be called.

Advanced Event Handling

The glomex script integration supports several events that you can leverage for more sophisticated implementations:

<script> /** * Called when no ad is available * Must be specified via the "onPassback" parameter */ window.glomexPassback = function() { console.log('Passback received'); // Handle the passback scenario when no ad is available }; /** * Called when the integration is ready with content * Must be specified via the "onReady" parameter */ window.glomexReady = function() { console.log('Ready received'); // Player is ready with content }; /** * Called when the integration has loaded * Must be specified via the "onLoad" parameter * Provides the player instance as a parameter */ window.glomexLoad = function(instance) { console.log('Integration loaded', instance); // Integration has been loaded and rendered }; /** * Called when content playback is complete * Must be specified via the "onComplete" parameter */ window.glomexComplete = function() { console.log('Content complete'); // Video has finished playing }; </script> <script src="https://player.glomex.com/integration/1/script.js?integrationId=REPLACE_WITH_INTEGRATION_ID&onPassback=glomexPassback&onReady=glomexReady&onLoad=glomexLoad&onComplete=glomexComplete"></script>

Event Reference

EventParameterDescription
onPassbackNoneTriggered when no ad is available
onReadyNoneTriggered when the integration is ready with content
onLoadinstanceTriggered when the integration has loaded and rendered
onCompleteNoneTriggered when content playback is complete
Last updated on