Outcome Tracking • Step 2

Prove ROI from AI

Track business outcomes from your AI features and automatically calculate ROI. Link outcomes to LLM transactions for instant value visibility.

Automatic ROI Calculation

Link outcomes to LLM transactions for instant value and ROI calculation.

Fuzzy Matching

No transaction ID? System automatically matches outcomes by timestamp and metadata.

Real-Time Dashboards

CFOs and CIOs see business value created in real-time on the Value Realization dashboard.

Required Attribution Headers

All outcome tracking requests must include these headers for proper attribution:

X-Org-ID
Your NotionAlpha organization ID
X-Team-ID
Your team ID (UUID format)
X-Environment
Environment: Production, Staging, or Development
X-Feature-ID
(Optional) Feature identifier for better outcome matching

💡 Tip: Use the validation endpoint /api/outcomes/validate to test your integration without saving data.

Code Examples

Two Simple Steps

1. Capture the transaction ID from your LLM proxy response
2. Track the outcome when your business event occurs

customer-support.ts
// Install: npm install @notionalpha/clarity-sdk openai
import { NotionAlphaClient } from '@notionalpha/clarity-sdk';

// Initialize client
const clarity = new NotionAlphaClient({
  orgId: process.env.NOTIONALPHA_ORG_ID!,
  teamId: process.env.NOTIONALPHA_TEAM_ID!,
  environment: 'production',
  featureId: 'customer-support-bot',
  provider: {
    type: 'openai',
    providerId: process.env.NOTIONALPHA_PROVIDER_ID!
  }
});

// Step 1: Make LLM call (FinOps + Security automatic)
const { response, transactionId } = await clarity.chat.completions.create({
  model: 'gpt-4o-mini',
  messages: [{ role: 'user', content: 'How do I reset my password?' }]
});

console.log(response.choices[0].message.content);
// ✅ Cost automatically tracked
// ✅ Security threats automatically detected

// Step 2: Track outcome (one line)
await clarity.trackOutcome({
  transactionId,
  type: 'customer_support',
  metadata: {
    ticketId: 'TICKET-456',
    timeSavedMinutes: 15,
    customerSatisfaction: 5
  }
});
// ✅ ROI automatically calculated

// View value realization
const value = await clarity.getValueRealization();
console.log(`ROI: ${value.roi}x`);

Supported Outcome Types

Track Any Business Metric

Customer Support

Track tickets resolved, time saved, and customer satisfaction scores.

customer_support

  • time_saved_minutes
  • customer_satisfaction (1-5)
Code Generation

Track code generated, developer hours saved, and quality scores.

code_generation

  • developer_hours_saved
  • quality_score (0-100)
Content Creation

Track content pieces created, items processed, and engagement metrics.

content_creation

  • items_processed
  • quality_score (0-100)
Sales & Marketing

Track leads qualified, emails personalized, and conversion rates.

sales_marketing

  • items_processed
  • quality_score (0-100)

Need help integrating outcome tracking? Contact our team