Conversion Tracking
Track revenue events and connect them to ad platforms for Return on Ad Spend (ROAS) reporting. The tracker automatically captures ad click IDs from Google, Meta, X, LinkedIn, and TikTok.
How It Works
User clicks your ad
The tracker auto-captures the click ID from the URL (gclid, twclid, fbclid, li_fat_id, li_ed, ttclid, etc.)
User converts
Your code calls usersesh.conversion() with the event name and revenue
UserSesh syncs to ad platforms
Conversions are matched to ad clicks via the stored click IDs and sent back to the ad platforms for ROAS reporting
API
usersesh.conversion(options: {
event: string; // Conversion name (e.g. "purchase", "signup")
revenue?: number; // Revenue amount (default: 0)
currency?: string; // ISO currency code (default: "USD")
metadata?: object; // Optional extra data
})Aliases: eventName works in place of event, value works in place of revenue, and properties works in place of metadata.
Examples
Free signup
// After successful signup
usersesh.conversion({ event: "signup", revenue: 0, currency: "USD" });Trial start
usersesh.conversion({
event: "trial_start",
revenue: 0,
metadata: { plan: "pro", trial_days: 14 }
});Purchase / subscription
usersesh.conversion({
event: "purchase",
revenue: 49.99,
currency: "USD",
metadata: { plan: "pro", interval: "monthly" }
});E-commerce order
usersesh.conversion({
event: "purchase",
revenue: 129.99,
currency: "USD",
metadata: {
order_id: "ord_789",
item_count: 3,
payment_method: "stripe"
}
});Using alongside track()
You can fire both track() and conversion() for the same action:
// Track the event for analytics
usersesh.track("subscription_started", {
plan: "pro",
amount: 29,
interval: "monthly"
});
// Also track as a conversion for ad ROAS
usersesh.conversion({
event: "purchase",
revenue: 29,
currency: "USD",
metadata: { plan: "pro" }
});Supported Ad Platforms
The tracker auto-captures click IDs from these platforms when a user arrives via an ad:
| Platform | Click ID Param | ROAS Sync |
|---|---|---|
| Google Ads | gclid | Dashboard → Ad Platforms |
| Meta (Facebook/Instagram) | fbclid | Dashboard → Ad Platforms |
| X (Twitter) Ads | twclid | Dashboard → Ad Platforms |
| LinkedIn Ads | li_fat_id | Dashboard → Ad Platforms |
| LinkedIn (organic) | li_ed | Auto-detected as Organic Social |
| TikTok Ads | ttclid | Dashboard → Ad Platforms |
| Microsoft Ads | msclkid | Dashboard → Ad Platforms |
Connect your ad accounts in the dashboard under Settings → Ad Platforms to enable conversion syncing.
Next steps
- Events & Identification — Custom event tracking and user identification
- SDK Reference — Full API reference
- MCP Server — Connect your AI IDE