Publishers · Ad formats

Task

A compact native row in your task list. The user opens the offer, comes back and claims a reward.

Earn

Join Crypto News

+100 coins

Start

Play Tower Rush

+250 coins

Claim

Follow on X

Done ✓

Done

What your user sees

A compact row: icon | title + reward | button. It looks like a normal task in your list.

  1. User taps the button → advertiser opens.
  2. User stays there at least 15 s and comes back.
  3. Button turns into Claim → user gets the reward.

Code

Put the element where you want the task to appear. That's it.

<adsun-task data-block-id="task-50003">
  <span slot="reward">+100 coins</span>
</adsun-task>

<script>
  const task = document.querySelector("adsun-task");
  task.addEventListener("reward", (e) => {
    // e.detail = block id → update the user's balance (from your server)
  });
  task.addEventListener("onBannerNotFound", () => task.remove()); // hide when empty
</script>

Custom buttons and texts

<adsun-task data-block-id="task-50003">
  <span slot="reward">+100 coins</span>
  <button slot="button">Go</button>
  <button slot="claim">Claim reward</button>
  <span slot="done">Completed</span>
</adsun-task>

Attributes

AttributeWhat it does
data-block-idYour Task block ID (required)
data-debug"true" shows a test task
data-debug-consoleLogs to the console in debug
data-tasks-countHow many tasks to show
data-task-refetch-afterSeconds before a new task loads (default 30)
data-force-campaign-idShow one specific campaign (testing)

Events

EventWhen
rewardTask completed — give the reward
onBannerNotFoundNo task available
onFastReturnUser came back too fast (< 15 s) — no reward
onTooLongSessionApp open for more than 4 hours — ask to restart
onFocusOut / onFocusInUser left / returned to your app
leave / returnSame moments, fired together with the two above
onErrorSomething went wrong — reason in event.error

Want it to match your design? See Task styling.

Still stuck? Write to support@adsun.io or our Telegram support — we answer fast.