Skip to content

Handling Postback Events

Postbacks are server-to-server (S2S) notifications that MomentScience sends to your system whenever a user interacts with an offer and generates a...

Overview

Postbacks are server-to-server (S2S) notifications that MomentScience sends to your system whenever a user interacts with an offer and generates a conversion or revenue event.

They allow your backend to automatically track conversions, credit users, process payouts, and synchronize reporting without any manual intervention.

Postback Events

How Postbacks Work

Postbacks enable MomentScience to notify your server whenever a user completes an offer, earns a reward, or generates revenue. This happens via a GET or POST request sent to your configured postback URL.

  1. User Interaction: A user clicks an offer in your app or website.
  2. Event Tracking: MomentScience records the click and monitors completion.
  3. Conversion Completion: The user completes the offer successfully.
  4. Postback Triggered: MomentScience sends a GETor POSTrequest to your server.
  5. Server Processing: Your server:
    • Parses the postback payload.
    • Updates your internal systems (e.g., rewards, payouts, analytics).
  6. Acknowledgment: Your server responds with HTTP 200 OK.
  7. Success Logging: MomentScience marks the postback as successfully delivered.
sequenceDiagram
  participant User as User
  participant App as Your App
  participant MS as MomentScience
  participant Server as Your Server

  User->>App: Clicks an offer
  App->>MS: Sends offer request
  MS->>App: Returns offer content
  User->>App: Completes conversion
  MS->>Server: Sends postback request (GET/POST)
  Server->>MS: Responds with 200 OK
  Server->>App: Updates user rewards

Why Use Postbacks

Postbacks are essential for real-time tracking, automated rewards, and accurate reporting. They allow your system to stay synchronized with MomentScience whenever a user completes an offer or generates revenue.

Benefit What it means Example
Real-time event tracking Receive instant updates when a conversion or payout occurs. Credit loyalty points instantly after offer completion.
Automated user rewards Automatically credit users with points, cashback, or perks. Add cashback to a user’s wallet right after conversion.
Seamless data syncing Keep your system aligned with MomentScience attribution data. Align revenue numbers in your BI dashboards.
Simplified reporting Eliminate manual reconciliation between systems. Double reward points for specific campaigns.
Flexible integration Choose between GET, POST, or macro-based URLs. Send conversion data to tools like Salesforce, Amplitude, or AppsFlyer.

How Postbacks Help

  • Track revenue from offer clicks and conversions.
  • Credit users for completed offers automatically.
  • Automate LoyaltyBoost multipliers and rewards.
  • Keep your systems fully synchronized without manual processing.

Configure Your Postback URL

Setting up postbacks involves two main steps:

  1. Create a server endpoint to receive postback notifications.
  2. Configure your postback URL in the MomentScience Dashboard.

Step 1: Create a Server Endpoint

Your server must have an endpoint that accepts incoming postbacks and processes them reliably.

Requirements

  1. Accept GETor POSTrequests, depending on your integration preference.
  2. Returns an HTTP 200 OK status code upon successful receipt
  3. Processes the received data asynchronously (recommended)
  4. Log all incoming requests, for debugging and reconciliation.
  5. Handles the data formats described later in this guide
https://api.yourcompany.com/momentscience/postbacks

Step 2: Configure Postback URL in Dashboard

After creating your endpoint, you must register it in the MomentScience Dashboard.

  1. Log in to your MomentScience dashboard
  2. Navigate to Tools > Postback & Webhooks
  3. Choose your desired HTTP method (GET, POST)
  4. Enter your postback URL
  5. Click Save .

Receiving Postback Data

MomentScience supports two methods for sending postbacks to your server:

  • GET: Sends data as URL query parameters.
  • POST: Sends data as a structured JSON body (recommended).

Choose the method that best fits your integration.

Option A: Using GET Method

With the GET method, MomentScience sends event data as URL query parameters.

  • Your endpoint receives a request where all postback fields are included in the query string.
  • Suitable for lightweight integrations where you only need simple key-value pairs.
https://api.example.com/postbacks?payout=2.10&timestamp=2023-09-20T15:27:40.802Z&offer_id=1511&advertiser_name=MomentScience&is_loyaltyboost=0&user_id=3410444

When to Use GET

  • For quick integrations where you want simple URL-based parameters.
  • When working with legacy systems that only accept GET.
  • Be cautious if your data payloads are large, since URL length has limits.

Option B: Using POST Method (Recommended)

With the POSTmethod, MomentScience sends a structured JSON payload in the request body. This is the recommended integration approach for most implementations.

  • Your endpoint receives a JSON object containing all postback fields.
  • Ideal when you need nested payloads, secure data handling, and better validation.
{
  "offer_id": "1511",
  "advertiser_name": "MomentScience",
  "payout": "2.10",
  "payload": {
    "user_id": "3410444",
    "session_id": "A90310222"
  },
  "timestamp": "2023-09-20T15:27:40.802Z",
  "is_loyaltyboost": "0"
}

When to Use POST

  • When you need structured data and nested objects.
  • For better security since data is not exposed in the URL.
  • Recommended for modern integrations and most server frameworks.

Postback Data Fields

When a user engages with an offer or completes a conversion, MomentScience sends a postback request to your configured server endpoint. The request includes structured data that helps you:

  • Credit user rewards
  • Track conversions
  • Reconcile payouts
  • Update reporting dashboards

Supported Postback Fields

Attribute Description
offer_id Unique identifier for the offer.
advertiser_name Name of the advertiser providing the offer.
payout Revenue earned from the conversion, in USD.
timestamp ISO 8601 timestamp when the conversion was recorded.
payload Any custom data passed when serving the offer (e.g., pub_user_id, session info).
is_loyaltyboost "1" if the offer is a LoyaltyBoost offer, "0" otherwise.

Handling LoyaltyBoost offers

When a postback is sent to your postback URL for a LoyaltyBoost offer, the payload structure remains the same as for non-LoyaltyBoost offer events, except for the is_loyaltyboost attribute, which will be returned as “1”.

In this scenario, you’ll need to examine the child “payload” object to find an attribute passed into the tracking link that identifies the user you intend to reward.

To reward users:

  1. Detect LoyaltyBoost offers (is_loyaltyboost = “1”)
  2. Extract the user identifier from payload (e.g., user_id)
  3. Convert payoutvalue to your internal reward system (e.g., points or credits)
  4. Credit the user’s account
  5. Record the reward transaction

Customizing GET Postbacks with Macros

If you’re using the GET method for receiving postbacks, you can dynamically insert values into your postback URL using macros. These macros are placeholders that MomentScience automatically replaces with real event data before sending the postback.

  • Macros are dynamic variables enclosed in { }.
  • At runtime, MomentScience replaces each macro with the actual event value.
  • This allows you to customize your endpoint URL to include specific user and offer information.

Learn more about Implementing Macros

https://api.example.com/postbacks?payout={payout}&user_id={user_id}&offer_id={offer_id}
https://api.yourcompany.com/postbacks?payout={payout}&user_id={user_id}&offer_id={offer_id}

During runtime, macros like {user_id}or {payout} will be replaced with actual values from the postback event.

Supported Macros

Macro Description Example Value
{payout} Revenue amount (USD) 2.10
{timestamp} ISO 8601 timestamp 2023-09-20T15:27:40.802Z
{offer_id} Offer ID 1511
{advertiser_name} Advertiser name MomentScience
{is_loyaltyboost} "1" for LoyaltyBoost, "0" otherwise 0
{any_payload_key} Custom payload values (e.g., {user_id}) 3410444

Retry Behavior

MomentScience ensures reliable delivery of all postbacks to your server. Whenever your endpoint fails to respond with HTTP 200 OK, the system automatically retries the request using an incremental backoff strategy.

How Retries Work

  1. When MomentScience sends a postback, your server must return an HTTP 200 OK response.
  2. If your server:
    • Responds with 200 OK → The postback is marked as successful.
    • Does not respond or returns an error → The postback enters a retry queue.
  3. MomentScience makes up to 5 delivery attempts for each postback: the initial attempt plus up to 4 retries.
  4. If all 5 attempts fail, the event is marked as permanently failed.
Attempt Delay Description
1 0s Initial attempt
2 60s First retry, one minute after failure
3 90s Second retry
4 120s Third retry
5 150s Final retry attempt

Viewing Postback History

The Postback & Webhooks in the MomentScience Dashboard allows you to manage postback settings, view historical data, and download reports for auditing and debugging. Use this feature to track delivery status, troubleshoot failed postbacks, and confirm that your integration is working as expected.

  1. Open the Postback & Webhooks
  2. Scroll to the postback history section: Below the settings panel, you’ll find the Postback History table. This table shows:
    • Event timestamps
    • Offer IDs and advertiser names
    • Payout amounts
    • Delivery status (success or failed)
    • HTTP response codes from your server
  3. Filter by date range
    • Click the date range selector.
    • Choose From and To dates manually or use the Shortcuts menu to quickly select a preset range (e.g., “Last 7 days,” “This month”).
    • Click Save changes to apply the filter.
  4. Refresh the data
    • To see the latest postback events, click the Refresh button above the history table.
  5. Export the history
    • Click Download CSV to export the filtered data.
    • The CSV file includes all event details for reconciliation, debugging, or external reporting.

If you encounter issues with your postback implementation, feel free to contact us at help@momentscience.com

Type to search…

↑↓ navigate↵ selectEsc close