Product
Publishers
Advertisers
Networks
Help
Pause animations
Browse help topics
Reference Publisher

Listen for wall events in your app

Updated

View as Markdown

Inside an iframe or a WebView, the wall posts a message for each thing that happens, with a type that starts with affiliateos.offerwall.. Use them to size the frame, close the wall and log what users do. Never credit a user from an event: real conversions reach you only as postbacks.

See also: Hosted Offerwall

On this page

The events

typePayloadSent when
affiliateos.offerwall.ready{ sessionId }The wall has loaded for a valid launch.
affiliateos.offerwall.height_changed{ height, tab }The wall loads, the user switches tab (all, trending or my), or an offer page opens or closes. Set your frame’s height to height.
affiliateos.offerwall.offer_started{ offerId, sessionId, testMode }The user tapped Get and the start was recorded, just before they’re sent to the offer.
affiliateos.offerwall.offer_redirect{ offerId, sessionId, url }Iframes only: the wall is about to open url in a new tab. A notice, not a request.
affiliateos.offerwall.conversion_updated{ offerId, goalId, sessionId }Only when a test goal completes. Test goals are switched off on live walls, so you won’t receive it today, and it’s never sent for real conversions.
affiliateos.offerwall.close_requested{ sessionId }The user tapped the wall’s close control. Hide the frame or dismiss the WebView: the wall can’t close itself.
affiliateos.offerwall.error{ error, offerId }Something failed. Codes below.

Listen in a web page

Give your iframe id="offerwall", and check where each message came from before you trust it.

JavaScript
const WALL = "https://offerwall.affiliateos.xyz";
const frame = document.getElementById("offerwall");

window.addEventListener("message", (event) => {
  if (event.origin !== WALL) return;
  const msg = event.data;
  if (!msg || typeof msg.type !== "string") return;

  switch (msg.type) {
    case "affiliateos.offerwall.height_changed":
      frame.style.height = msg.height + "px";
      break;
    case "affiliateos.offerwall.close_requested":
      frame.remove();
      break;
    case "affiliateos.offerwall.error":
      console.warn("Wall error", msg.error, msg.offerId);
      break;
  }
});

In a WebView, the wall posts to its own window instead. Inject a script that listens for the same messages there and forwards them through your WebView’s bridge. Add the wall to an app explains it.

Error codes

errorWhat happenedWhat the user sees
click_failedThe start couldn’t be recorded.“The offer didn’t open. Try again.”
missing_redirect_urlThe start was recorded but came back with no offer link.“The offer didn’t open. Try again.”
redirect_blockedIframes only: the browser blocked the new tab. The wall then tries to move your whole page to the offer.Your page may change to the offer. If it can’t, nothing opens, so open url from the offer_redirect you just received.

Who receives them

Where the wall runsWho hears the events
An iframe, on a wall with allowed originsYour page, when its origin is on the list. Other pages hear nothing, and the browser won’t show the frame there anyway.
An iframe, on a wall with no listAny page that frames it. The events carry no session token and no secret.
Your own WebViewThe wall’s own window, where your injected script picks them up.
A browser tab (SFSafariViewController, Custom Tabs, a plain browser)Nobody. Your app gets no events from a tab.

About sessionId

sessionId is the same on every event of one visit and different on the next. Use it to group events and match them to your own logs. It isn’t a credential, it can’t be used to call our API and its format has changed before, so store it as an opaque string.

Support

Still stuck? Write to us.

One address for every question: hello@affiliateos.ai. Put the details from this list in your first message so we can find the click or conversion without asking you for them again.

Put these in your message

  1. 01The email you sign in with
  2. 02Your role: publisher, advertiser or network
  3. 03The offer ID
  4. 04The click ID or action_id
  5. 05The time it happened, with your time zone
  6. 06What you expected to happen

Looking for a reward in an app? Ask that app's support. It credits your reward, so only it can see your balance.

Search help