Postbacks

Overview #

Monetag SDK for Telegram Mini Apps allows you to monetize your app by displaying ads — but showing an ad is only half the story.

To complete the monetization cycle, you need to know when an ad was actually shown or clicked, and optionally reward the user. This is where two mechanisms come into play:

  • Frontend Callbacks — triggered inside your app via the SDK
  • Server-Side Postbacks — triggered from Monetag’s backend when an event is confirmed

Frontend Callback #

When you use the Monetag SDK and call show_XXX(), it returns a Promise. This mechanism is known as a Frontend Callback.

By default, the Promise resolves after the SDK attempts to show the ad — regardless of whether the ad was ultimately shown or monetized.

show_XXX().then(() => {
  // Frontend Callback triggered
  // You can reward the user here (if applicable)
});

However, Monetag offers an optional mode that can be enabled per SDK upon request, in which the Promise resolves only after backend confirmation that the ad event (e.g., impression or click) was successfully processed.

⚙️ To enable backend-confirmed callbacks, please contact your account manager or support team.

When to use Frontend Callback

Frontend Callbacks are useful when:

  • You want to update the UI (e.g., show “Reward granted!”)
  • You’re working with simple or non-critical logic
  • You’re using non-rewarded or optional ads

⚠️ Important: By default, Frontend Callbacks do not guarantee monetization. They only confirm that the SDK executed the ad logic.

Server-Side Postbacks #

Server-side postbacks are HTTP requests sent from Monetag to your backend when a monetized event is confirmed in our system — such as:

  • A user viewed an ad (impression)
  • A user clicked an ad (click)

They are essential when:

  • You want to grant reliable rewards from your backend
  • You need trusted data for analytics or billing
  • You need protection from fraud or client-side manipulation

Example request:

GET https://your-backend.com/postback?ymid=user123&event=click&zone_id=xxxxxx&request_var=start_button&telegram_id=123324&estimated_price=0.0023

Which should I use? #

Use CaseFrontend CallbackServer-Side Postback
Show success messageOptional
Track exact monetization
Reward user with coins⚠️ Risky
Trigger analytics event
Fraud protection
Offline reliability

Summary #

  • Use Frontend Callbacks for UI and simple reward logic
  • Use Server-Side Postbacks for verified monetization and backend-driven rewards
  • You can use both in parallel — UI via callback, accounting via postback

The next section will explain the types of events you can track.