Setting up conversion postbacks for web landing links
WARNING
The instructions in this section do not apply to Telegram Ads campaigns. For instructions on setting up conversion postbacks for web links in Telegram Ads, see here.
Parameters:
token— a unique token associated with your account. It is available in the AdsGram dashboard and can be regenerated if necessary.How to get your token:
- Open the AdsGram dashboard.
- Click your profile in the top-right corner.
- Find the
tokenparameter and click the copy buttonto copy it.

record— a unique value for each click or impression, corresponding to the{record_data}macro. AdsGram automatically inserts this value into the tracking link.goaltype— a parameter that specifies the type of conversion (funnel stage), helping to segment various user actions. It accepts integer values from 1 to 3.goaltype usage:
- Define the funnel stages in your product or service.
- Map the stages to goaltype values:
- Registration
- First deposit/purchase
- Repeat deposit/purchase
- Configure conversion tracking for the relevant stages of the user journey.
- Add the goaltype parameter to your API request when sending conversion data.
- Use this parameter in your analytics to perform a detailed performance analysis by conversion type.
How to set up conversion tracking:
- Select a campaign. Use an existing active campaign or create a new one.
- Configure the tracking link. Make sure it contains the
{record_data}macro. - Get your token. Copy your unique token from the AdsGram dashboard.
- Set up postback delivery. Configure your server to send an API request to AdsGram whenever a user completes a target action.
- Specify the conversion type. Set the appropriate
goaltypevalue if you want to distinguish between funnel stages. - Test the integration. Follow the steps in the Integration testing section below and verify that conversions appear in AdsGram statistics.
Example of API request upon conversion:
GET
https://api.adsgram.ai/confirm_conversion?token=YOUR_UNIQUE_TOKEN&record=7f3a1b6c5d2e4f8a&goaltype=2In this example, goaltype=2 represents a conversion such as a first deposit or purchase.
Replace YOUR_UNIQUE_TOKEN with your account token and 7f3a1b6c5d2e4f8a with the actual {record_data} value from the tracking link.
Expected response: 200 OK — the conversion has been successfully registered.
Integration testing
To test conversion tracking, follow these steps:
- Create or select a campaign. Configure the tracking link according to the documentation and make sure it contains the
{record_data}macro. - Wait for clicks. Wait until users have clicked the tracking link several times.
- Send a test postback manually with the
goaltype=1parameter. Specify a valid token in thetokenparameter and the actual{record_data}value from the tracking link that was clicked in therecordparameter. - Check the result. Verify that the request was processed successfully and that the conversion appears in AdsGram statistics for the selected campaign.
Troubleshooting
- The conversion appears in statistics: the integration is configured correctly and working for the tested scenario.
- The server returns an error: check the request URL and the values of the
token,record, andgoaltypeparameters. - The request succeeds, but the conversion does not appear: statistics are updated once per hour. If the conversion is still missing after one hour, contact AdsGram Support or your account manager. Be sure to include the request and response logs in your support request.