Ads & revenue · Demo 5 of 5
Your own iframe ad decides when to continue
Sponsored content, a product teaser, a direct-sold campaign: an Ad block can frame any page you host. That page tells the Riddle when the reader may continue.
Riddle features: Ad block iframe
Setup: about 20 minutes
Any HTML creative you host
Live Riddle
Quiz · 3 questions + sponsor page
Answer two questions to reach the sponsor page. Its countdown, not Riddle, decides when you can go on.
What just happened
The creative holds the key to the next block.
01
The Ad block frames your page
Instead of an ad slot, the block loads a URL you host. Its next button is hidden.
02
Your page runs its own logic
Here a five-second countdown and a button. It could be a video, a product picker or a mini form.
03
One message continues the quiz
postMessage({'ad-iframe-complete': true}) to www.riddle.com moves the Riddle to the next block.
Build it yourself
The creative and the Riddle settings.
1 · Your creative page
The page the Ad block frames. Everything else on it is up to you.
<button id="go" disabled>Continue in 5…</button>
<script>
var left = 5, btn = document.getElementById('go');
var t = setInterval(function () {
if (--left > 0) { btn.textContent = 'Continue in ' + left + '…'; return; }
clearInterval(t); btn.disabled = false; btn.textContent = 'Continue the quiz';
}, 1000);
btn.onclick = function () {
window.parent.postMessage({ 'ad-iframe-complete': true }, 'https://www.riddle.com');
};
</script>
2 · In the Riddle Creator
One Ad block with an iframe instead of a slot.
- Ad block → iframe: your page URL and a height (here 260 px).
- Next button: hide it, so only your page can continue.
- Your page: allow framing by https://www.riddle.com (frame-ancestors).
- When done: send ad-iframe-complete to https://www.riddle.com.
Your page, your rules
Always leave a way forward.
- If the creative fails to load, readers are stuck. Add a fallback, such as continuing after 30 seconds.
- Cookies and tracking in the creative are yours: cover them in your consent setup.
- Post the message to https://www.riddle.com only, never to '*'.
Want to build this yourself?