Documentation

Requirements for MRAID Ads

Impression tracking with MRAID creative:
Creative should contain a script that will trigger impression trackers in mraid.viewableChange event (if you want to track impressions inside the creative).

So when the creative is shown, SDK Renderer triggers that event and trackers are automatically triggered by your script.

Example:

<script src="mraid.js"></script>
<script type="application/javascript">
    // Wait for the SDK to become ready
    if (mraid.getState() === 'loading') {
        mraid.addEventListener('ready', onSdkReady);
    } else {
        onSdkReady();
    }
    function onSdkReady() {
    // Wait for the ad to become viewable for the first time
        if (mraid.isViewable()) {
            showMyAd();
        } else {
            mraid.addEventListener('viewableChange',
                function(viewable) {
                    if (viewable) {
                        mraid.removeEventListener('viewableChange', arguments.callee);
                        showMyAd();
                    }
                }
            );
        }
    }
    function showMyAd() {
        sendImpressionTrackers();
        ...
    }
</script>

🚧

Important

If you are using impression pixels in the creative, you should move them to seatbid.bid.ext.imptrackers (Bid object) or use them with mraid event viewableChange