A video your visitor chooses to watch in exchange for something you give — the rest of an article, a download, a game life. The ad server confirms the view before the reward is granted.
This is a live zone on a demo account with 15 made-up advertisers. Click the button below to unlock the article, then look at the code.
The visitor decides: watch a short video, get something in return — the rest of an article, a download, an extra game life. Nothing plays until they click, and closing the video early simply means no reward.
Some train journeys are worth taking for the window seat alone. From glaciers to fjords, these five lines turn the trip itself into the holiday — and most of them run all year.
We rode every one of them this summer. Here is where to sit, when to book and which stretch you should not sleep through.
Four hours from Chur to Tirano over 196 bridges and through 55 tunnels, past the Morteratsch glacier. Sit on the right going south for the Brusio spiral viaduct.
Twenty kilometres and nearly 900 metres down from Myrdal to the Aurlandsfjord. The train stops at the Kjosfossen waterfall; take the first departure to beat the crowds.
Glasgow to Mallaig across Rannoch Moor and the Glenfinnan Viaduct. Book the left side northbound, and the morning train for the best light on the lochs.
Porto to Pocinho along the river through the terraced vineyards of the port wine valley. In September the harvest is on and the hills turn gold.
Short hops between five cliff villages, every few minutes. Buy the Cinque Terre card and get off wherever the light is good.
The rest of this guide is free — watch one short video to read it.
The ad server confirmed the view and signed this token with the zone's reward secret:
<!-- once per page, in <head> -->
<script src="https://g2.gsrv.dev/ctrl/19460.js"></script>
<!-- where it goes -->
<button type="button" id="watch_ad_12512626">Watch a short ad to unlock</button>
<script>
goCtrl.add({"plugin":"rewarded","fn":"init","fn_params":{"sid":12512626,"button":"#watch_ad_12512626","uid":""}});
</script>Rewarded is a setting on a video zone: tick Rewarded ad and the zone code becomes a button plus one line of script. You can also start it from your own page with goCtrl.rewarded.show({sid: 12512626, uid: "your-user-id", onReward: function (r) { … }}).
The video plays in a dialog with a countdown. When it ends, the ad server checks the reward before it grants it: the ad really came from this zone, it was served at least the zone's minimum watch time ago, and each ad view is rewarded only once. A second claim for the same view is refused.
Your page gets a token in onReward and as the window event goctrl:reward. Fill in a reward URL in the zone and the ad server also calls your server directly, so you never have to trust the browser to grant the reward.
To check a token on your server: it reads <payload>.<signature>. Decode the payload (base64url) — <zone id>.<campaign id>.<user id>.<unix time> — and compare the signature with HMAC-SHA256 of the payload using the zone's Reward secret from the panel. The secret stays on your server; this demo never shows it. See Video ad zones in the docs.
Every format on this page is part of the GoAdserver ad server. Talk to us about your platform.
Contact us