CAPI Events
This guide explains how to configure the Conversions API events AdTarget sends to Meta when users join your Telegram channel.
When Are CAPI Events Sent?
AdTarget sends a CAPI event to Meta only for attributed joins — meaning joins where AdTarget can match the Telegram join back to a specific ad click on your landing page. This requires the invite_link to be present in Telegram’s webhook.
CAPI events are sent when a user clicks your tracked invite link and Telegram reports it in the webhook (reliable for private channels).
CAPI events are NOT sent for organic joins — users who find your channel via search, direct links, or forwarded messages. These joins still appear in your AdTarget dashboard but are marked as “organic.”
Public channel limitation: Due to a Telegram API limitation, even users who click your tracked link may be treated as organic joins on public channels. Telegram’s app (especially Android) often converts invite-link joins into “direct joins” for public channels, stripping the attribution data. Learn more →
Available Event Types
AdTarget can send these standard Meta events:
| Event | Best For | Meta Optimization |
|---|---|---|
| Lead | Lead generation campaigns | Optimizes for lead intent |
| Purchase | Purchase-focused campaigns | Optimizes for purchase actions |
| CompleteRegistration | Signup-focused campaigns | Optimizes for registration actions |
| Subscribe | Subscription campaigns | Optimizes for subscription intent |
| Custom | Custom event name | For specialized tracking needs |
Choosing the Right Event
Running lead gen ads? Use Lead — This tells Meta “this person became a lead.”
Selling a product or service? Use Purchase — Best when you want Meta to optimize for buyers. Pair it with a value and currency in your channel’s conversion config for value-based optimization.
Running signup campaigns? Use CompleteRegistration — Signals a completed signup action.
Promoting a channel subscription? Use Subscribe — Matches the user action (joining = subscribing).
Need a non-standard event? Use Custom — Lets you define your own customEventName for specialized tracking scenarios that don’t fit the standard types.
Tip: Match your event type to your campaign objective in Ads Manager for best results.
Configuring Events
Event types are configured per channel. Each channel defaults to Lead when first detected.
To change a channel’s event type:
- Go to your site’s Settings → Channels tab
- Click Setup (or Edit) on the channel row
- Select your event type in the dialog
- Click Save
Event Parameters
Each event AdTarget sends includes these parameters:
Required Parameters
| Parameter | Description |
|---|---|
event_name | The event type (Lead, etc.) |
event_time | Unix timestamp of the join |
action_source | Always “website” |
Attribution Parameters
| Parameter | Description |
|---|---|
fbc | Click tracking cookie (contains the fbclid from the ad click, formatted as fb.1.{timestamp}.{fbclid}) |
fbp | Browser tracking cookie value (Meta browser ID) |
User Data
If available, AdTarget sends user data for matching:
| Parameter | Source | Hashed? |
|---|---|---|
external_id | Telegram user ID | Yes (SHA-256) |
client_ip_address | IP from landing page visit | No (sent as-is) |
client_user_agent | Browser from landing page visit | No (sent as-is) |
The external_id (Telegram user ID) is SHA-256 hashed before sending, as recommended by Meta. Other parameters like IP address and user agent are sent as-is, which is consistent with Meta’s CAPI specifications for these fields.
Custom Data
AdTarget also sends these fields inside the custom_data object of each CAPI event:
| Parameter | Description |
|---|---|
event_source_url | Landing page URL (constructed from site domain + visit path) |
value | Event value (if configured per channel) |
currency | Currency code (defaults to "USD") |
content_name | Channel title or custom name from channel config |
Event Deduplication
AdTarget includes a unique event_id with each event to prevent duplicates:
event_id: "adtarget_{conversion_id}"This ensures the same conversion isn’t counted twice, even if retried.
Testing Events
Validation Test Event
When you save your pixel during setup, AdTarget automatically sends a PageView test event with the code ADTARGET_TEST. You can see this in Meta Events Manager under the Test Events tab — it confirms your pixel ID and access token are working.
Test in Production
The most reliable way to test end-to-end:
- Click your own ad (or use a test ad)
- Visit your landing page
- Join your Telegram channel via the tracked invite link
- Check Events Manager within 5 minutes
Event Matching
Meta matches your events to users for attribution. Higher match quality = better optimization.
Match Quality Factors
| Factor | Impact |
|---|---|
| fbc present (contains fbclid) | High - Direct click attribution |
| User agent + IP | Medium - Probabilistic matching |
| External ID | Medium - Cross-device matching |
Improving Match Quality
- Capture fbclid: Ensure your landing page URL preserves the fbclid parameter
- Send events promptly: Shorter time between click and conversion improves matching
- Consistent user journey: Keep users on your domain before redirecting to Telegram
Common Event Configurations
Lead Generation
Event Type: Lead
When: User joins channel
Use Case: "Get subscribers" campaignsPurchase Tracking
Event Type: Purchase
When: User joins channel
Use Case: "Buy now" campaigns with value-based optimizationContent Subscription
Event Type: Subscribe
When: User joins channel
Use Case: "Subscribe to channel" campaignsMulti-Channel Setup
Channel A (free content): Lead
Channel B (premium): Purchase
Channel C (subscription): SubscribeTroubleshooting
Events not matching?
- Check fbclid is in the landing page URL
- Verify Meta Pixel is also on the landing page
- Ensure cookies aren’t blocked
Event quality score is poor?
- Increase the data you send (IP, user agent)
- Reduce time between click and conversion
- Verify fbclid is being captured
Duplicate events?
- AdTarget handles deduplication automatically
- If seeing duplicates, contact support
Best Practices
- Match event type to campaign objective for better optimization
- Use the same event type consistently within a campaign
- Monitor event quality in Events Manager weekly
- Test before scaling ad spend
Next Steps
Your Meta integration is complete! Start running ads and watch your conversions flow into Meta.
Need help optimizing? Contact our support team.