---
updatedAt: 2025-09-22T23:25:49.000Z
agentTools:
  projectIndex: https://developer.bitlabs.ai/llms.txt
---

# Getting started

In this guide we'll go through the basic requirements to analyse callback data to understand your integration's performance

# Callback integration

> ❗️ Before proceeding, make sure that your callback integration is working properly
>
> To proceed with this guide, we assume that:
>
> 1. You have already set-up the [general reward callbacks](https://developer.bitlabs.ai/docs/general-reward-callbacks).
> 2. If you use [magic receipts](https://developer.bitlabs.ai/docs/magic-receipt-callbacks) or [offers](https://developer.bitlabs.ai/docs/offer-callbacks), stateful callbacks are enabled.
> 3. You are receiving callbacks properly. (You can double check this from the integration dashboard)

## Required callback parameters

Your callback integration must be configured to receive the following attributes:

* User ID `[%UID%]`
* Reward `[%VAL%]`
* Gross revenue `[%RAW%]`
* Transaction ID `[%TX%]`

Additionally, depending on the type of callbacks being used:

* General reward callbacks
  * Survey state `[%TYPE%]`
* Offer callbacks
  * Offer ID `[%OFFER_ID%]`
  * Task ID `[%TASK_ID%]`
  * Offer state `[%OFFER_STATE%]`
  * Offer IAP value `[%OFFER:TASK:IAP:USD%]`
  * Offer event type `[%OFFER:TASK:TYPE%]`
* Magic receipt callbacks
  * Receipt state `[%MAGIC_RECEIPT_STATE%]`
  * Offer ID `[%RECEIPT:OFFER:ID%]`
  * Upload ID `[%RECEIPT:UPLOAD:ID%]`
  * Upload offer ID `[%RECEIPT:UPLOAD:OFFER:ID%]`
* Cashback callbacks
  * Cashback state `[%CASHBACK:STATE%]`
  * Merchant ID `[%CASHBACK:MERCHANT:REF%]`
  * Order ID `[%CASHBACK:ORDER:ID%]`

## Optional callback parameters

Additionally, we also recommend to collect the following parameters that could be useful to debug user requests or understand system events:

* Magic receipt callbacks
  * Rejection reason `[%MAGIC_RECEIPT_REASON_ID%]`

# Understanding callback data

Now that you have callback data in your system, you might want to start calculating overall metrics, per-user metrics, per-product metrics... But we recommend going through the existing data first, so you can understand the limitations and good practices so everything works as expected.

## What does a callback represent?

Each callback event, represents an interaction with our system, either from your end-users or one of our partners, but it will **always** be associated to a transaction, that's why setting-up callbacks so you receive the transaction id (`[%TX%]`) is essential.

## What is the state flow?

<Image alt="Callback states for each integration" align="center" src="https://files.readme.io/7ec187878908e58e17b8495fca2767f439a58695518a4e7df9b6674f93aac545-Blank_diagram_1.svg">
  Callback states for each integration
</Image>

On the image above, the states with blue edges are final states, meaning that they will not change, the black circle represents the initial state.

## Considerations

* When calculating metrics, beware that a callback does not equal an interaction from the user
  * User activity-related metrics should not be calculated based on all callbacks, but rather the first callback for each TX identifier.
* Callbacks could be duplicated, or delayed.