Setting up conversion postbacks for Telegram ecosystem landing links
WARNING
The instructions in this section do not apply to Telegram Ads campaigns. For more information on conversion tracking for links within Telegram in Telegram Ads campaigns, see this section.
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.

tgid— the Telegram ID of the user who clicked the advertising link.campaignid— the ID of the AdsGram advertising campaign associated with the conversion. It corresponds to the value of the{campaign_id}macro passed in the advertising link. AdsGram inserts the macro value when a user clicks the 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 advertising link. Make sure it contains the
{campaign_id}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.
API request example upon conversion:
GET
https://api.adsgram.ai/confirm_conversion?token=YOUR_UNIQUE_TOKEN&tgid=98110997&goaltype=2&campaignid=72156In this example, a conversion of type 2 is reported, such as a first deposit or purchase.
Replace the example values with your actual data:
YOUR_UNIQUE_TOKEN— your AdsGram account token;98110997— the Telegram ID of the user who clicked the advertising link;72156— the ID of your advertising campaign.
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 advertising link according to the documentation and make sure it contains the
{campaign_id}macro. - Wait for clicks. Wait until users have clicked the advertising link several times.
- Get the user's Telegram ID. Obtain the
tgidof a user who clicked the link for the selected campaign. - Send a test postback manually. Set
goaltype=1and provide a valid token, the user's Telegram ID in thetgidparameter, and the test campaign ID in thecampaignidparameter. - 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 as expected.
- The server returns an error: check the request URL and the values of the
token,tgid,campaignid, 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.