Publishers · Getting started
Create an ad block
Pick a block type (Reward, Interstitial, Task), set the Reward URL and copy your integration code.
An ad block is one ad placement in your app — for example “Watch ad for 2× speed” or “Tasks list”. Each block has its own ID, statistics and code.
Choose the block type
| Type | What the user sees | Best for | Block ID looks like |
|---|---|---|---|
| Reward | Full-screen video, cannot be skipped | Coins, lives, boosters, “one more try” | 50001 |
| Interstitial | Full-screen image/video, closable after 5 s | Between levels, after a result screen | int-50002 |
| Task | A small card in your task list | Earn pages, daily tasks | task-50003 |
The panel gives every new block a plain number, for example 50001. Some blocks carry a prefix that matches their type — int- for Interstitial, task- for Task — and older blocks use tw-. Copy the ID exactly as the panel shows it; the SDK accepts all three forms.
WARNING
Fill in the form
- Block name — e.g. “Double coins button”. Only you see it.
- Block type — Reward, Interstitial or Task. The one you picked is highlighted.
- Reward URL (optional) — the address on your server that Adsun calls when a user earned the reward. The field shows up for Reward and Task blocks, not for Interstitial. Learn how →
- Advanced SDK settings (optional) — for Reward and Interstitial: Seconds between ads (0–3600, default 5) and Ads per user / day (1–10000, default 300). For Task blocks: Min. time away (s) (5–600, default 15) and New task after (s) (5–3600, default 30).
Get the code
On the block page press the Block configuration button (the </> icon at the left of Edit). Switch between Basic and All options — the second one lists every init option and event — then press Copy code. Both already contain your real block ID.
<script src="https://api.adsun.io/sdk.js"></script>
<script>
const AdController = window.Adsun.init({ blockId: "50001" });
AdController.show()
.then((result) => {
// user watched till the end: give the reward
})
.catch((result) => {
// skipped, no ad or error
});
</script>Still stuck? Write to support@adsun.io or our Telegram support — we answer fast.