For the complete documentation index, see llms.txt. This page is also available as Markdown.

Iframe Events

Advertisers are able to track events in their Ads. These events are programmatically managed directly in the client browser with the help of JavaScript.

Events

creativeDisplayed

This is only available for Desktop Fullpage Interstitial and Mobile Fullpage Interstitial (DFPI/MFPI) Ad Format campaigns with iframe URL variation.

When the ad is displayed to the user, a message is sent into the iframe called creativeDisplayed.

You can track this event inside your iframe by using the script below, which adds an event listener to catch the sent message once the ad is displayed to the user.

<script>
        function readMessage(event) {
            console.log("readMessage event");
            console.log("origin: " + event.origin);
            console.log("data: " + event.data);
        }

        if (window.addEventListener) {
            // For standards-compliant web browsers
            window.addEventListener("message", readMessage, false);
        } else {
            window.attachEvent("onmessage", readMessage);
        }
</script>

Example - Fullpage Interstitial

Last updated

Was this helpful?