For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Iframe Events

Advertisers can 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 (DFI/MFI) Ad Format campaigns with iframe URL variation.


When the ad displays, it sends a creativeDisplayed message to the iframe.

Use the following event listener inside the iframe to track this message once the ad is displayed to the user.

<script>
        function readMessage(event) {
            // Only accept messages from the network's ad-serving domain
            if (event.origin !== "https://s.<network-domain>") return;
            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?