Custom Integrations ​
When the Custom (postMessage) integration is enabled for a Videobot, it sends analytics events to the parent page using iframe messages. To learn more about how they work, see this guide on MDN.
This allows the parent page to listen to analytics events and forward them to any third-party analytics platform.
First-class integrations available
For Matomo, Piwik PRO, Adobe Analytics, and Google Tag Manager, Videobot now provides built-in integrations that require no custom JavaScript. See Configuring Integrations for details.
Setting Up ​
First, enable Custom (postMessage) for the Videobot from the dashboard, within the Videobot Settings tab, under the Tracking & analytics heading.
After the feature is enabled, the Videobot will start sending analytics events via iframe messages. Use one of the relay scripts below to forward events to your analytics platform.
Relay: Google Tag Manager / Piwik PRO (dataLayer) ​
<script>
window.addEventListener('message', function(event) {
if (event.origin !== 'https://videobot.com') {
return
}
if (event.data.action !== 'VIDEOBOT_ANALYTICS_EVENT') {
return
}
window.dataLayer = window.dataLayer || []
window.dataLayer.push(
Object.assign({ event: event.data.eventName }, event.data.data)
)
})
</script>Relay: Matomo Tag Manager (_mtm) ​
<script>
window.addEventListener('message', function(event) {
if (event.origin !== 'https://videobot.com') {
return
}
if (event.data.action !== 'VIDEOBOT_ANALYTICS_EVENT') {
return
}
window._mtm = window._mtm || []
window._mtm.push(
Object.assign({ event: event.data.eventName }, event.data.data)
)
})
</script>Relay: Adobe Analytics (Launch / Direct Call Rules) ​
<script>
window.addEventListener('message', function(event) {
if (event.origin !== 'https://videobot.com') {
return
}
if (event.data.action !== 'VIDEOBOT_ANALYTICS_EVENT') {
return
}
if (window._satellite) {
window._satellite.track(event.data.eventName, event.data.data)
} else if (window.adobeDataLayer) {
window.adobeDataLayer.push({
event: event.data.eventName,
eventInfo: event.data.data
})
}
})
</script>Each script does the following:
- Listens to all iframe
postMessageevents - Ensures they come from the Videobot domain
- Filters to events related to analytics
- Forwards the event to the target analytics platform
Further Reading ​
To understand what types of events will be sent by Videobot, refer to the Supported Events article.
For platform-specific setup guides (triggers, tags, variables), see: