Outbrain Event Tracking | OpsBlu Docs

Outbrain Event Tracking

Implement Outbrain Pixel event tracking for conversions, custom actions, and engagement metrics to optimize native ad campaigns.

Event Tracking Overview

Outbrain's event tracking system enables you to measure user actions beyond simple page views. By instrumenting conversion events, engagement signals, and custom interactions, you can optimize campaigns for meaningful business outcomes and build sophisticated retargeting audiences.

Standard Conversion Events

Purchase / Transaction

Track ecommerce transactions with revenue, product details, and order information.

obApi('track', 'Conversion', {
  orderValue: 149.99,           // Total transaction amount
  orderId: 'ORD-2024-001234',   // Unique order identifier
  currency: 'USD',              // ISO 4217 currency code
  productId: 'PROD-ABC-123',    // Optional: Product SKU or ID
  productName: 'Widget Pro',    // Optional: Product name
  category: 'Electronics'       // Optional: Product category
});

When to Fire:

  • On order confirmation page after successful payment
  • After backend validates transaction (for server-side tracking)
  • Once per unique transaction (prevent duplicate fires on page refresh)

Best Practices:

  • Use actual revenue (after discounts, excluding tax/shipping if preferred)
  • Include unique order ID to enable deduplication
  • For multi-product orders, send total order value (not per-item)

Lead Generation

Track lead form submissions, contact requests, or quote inquiries.

obApi('track', 'Conversion', {
  orderValue: 50,               // Estimated lead value or set standard value
  orderId: 'LEAD-2024-5678',    // Unique lead identifier
  currency: 'USD',
  leadType: 'Contact Form',     // Optional: Type of lead
  leadSource: 'Website'         // Optional: Source channel
});

When to Fire:

  • On thank-you page after form submission
  • When form validation succeeds and lead is captured in CRM
  • After email confirmation (if required for lead qualification)

Lead Value Guidelines:

  • Use estimated customer lifetime value (LTV) if known
  • Assign different values for lead quality tiers (e.g., demo request = $100, newsletter signup = $10)
  • Update values quarterly based on actual conversion rates from leads to customers

Signup / Registration

Track new user registrations, account creations, or subscription signups.

obApi('track', 'Conversion', {
  orderValue: 0,                // Set to 0 if no immediate revenue
  orderId: 'USER-2024-9012',    // Unique user ID
  currency: 'USD',
  accountType: 'Free Trial',    // Optional: Account tier
  signupMethod: 'Email'         // Optional: OAuth, Email, Phone
});

When to Fire:

  • On welcome page after successful registration
  • After email verification (if required)
  • When user completes onboarding flow

Valuation Strategy:

  • Set to $0 for free signups, optimize for volume
  • Set to expected subscription value for paid trials
  • Use LTV for SaaS products with known conversion rates

Download / Asset Access

Track content downloads, whitepaper access, or gated resource views.

obApi('track', 'Conversion', {
  orderValue: 5,                // Nominal value for content engagement
  orderId: 'DL-2024-3456',      // Unique download event ID
  currency: 'USD',
  assetName: 'Q4 Industry Report',  // Downloaded asset name
  assetType: 'PDF'              // File type or content format
});

When to Fire:

  • On download confirmation page or after file transfer begins
  • When user unlocks gated content by providing email
  • On content view page for premium articles or videos

Custom Event Tracking

Beyond standard conversions, track custom events that indicate engagement or intent.

Add to Cart

obApi('track', 'AddToCart', {
  productId: 'PROD-XYZ-789',
  productName: 'Premium Widget',
  productValue: 79.99,
  currency: 'USD',
  quantity: 2
});

Use Cases:

  • Build retargeting audiences of users who added items but didn't purchase
  • Optimize campaigns for mid-funnel actions, not just final conversions
  • Calculate cart abandonment rates from Outbrain traffic

Video View

obApi('track', 'VideoView', {
  videoId: 'VID-001',
  videoName: 'Product Demo',
  percentageWatched: 75,        // 0-100
  duration: 120                 // Video length in seconds
});

Trigger Points:

  • Fire at 25%, 50%, 75%, and 100% completion
  • Track video starts separately from completions
  • Use for content engagement scoring and audience segmentation

Search / Intent Signal

obApi('track', 'Search', {
  searchQuery: 'blue widgets',
  resultsCount: 24,
  category: 'Products'
});

Applications:

  • Identify high-intent users based on search behavior
  • Retarget users who searched but didn't convert
  • Optimize content recommendations based on search patterns

Custom Engagement Events

obApi('track', 'CustomEvent', {
  eventName: 'Free Trial Started',
  eventCategory: 'Engagement',
  eventValue: 25,
  eventLabel: '14-Day Trial'
});

Custom Event Ideas:

  • Free trial activations
  • Calculator or tool usage
  • Newsletter subscriptions
  • Chat interactions or support ticket submissions
  • Social shares or referrals

Event Parameters & Data Schema

Required Parameters

  • eventType (string): Type of event (Conversion, AddToCart, VideoView, CustomEvent)
  • orderValue (number): Monetary value or estimated value
  • currency (string): ISO 4217 code (USD, EUR, GBP, etc.)

Optional Parameters

  • orderId (string): Unique transaction or event identifier for deduplication
  • productId (string): Product SKU or identifier
  • productName (string): Human-readable product name
  • category (string): Product or content category
  • quantity (number): Number of items or units
  • custom1 through custom5 (string): Additional custom dimensions

Data Type Requirements

  • Numeric values: Must be numbers, not strings (e.g., 99.99 not "99.99")
  • Currency codes: Three-letter uppercase (e.g., USD not usd or $)
  • Order IDs: Unique per transaction, alphanumeric strings
  • Timestamps: ISO 8601 format for server-side events (e.g., 2024-01-15T14:30:00Z)

Event Timing & Placement

Client-Side Event Timing

On Page Load:

// Fire immediately when page loads
obApi('track', 'Conversion', {
  orderValue: 99.99,
  orderId: 'ORD-12345',
  currency: 'USD'
});

On User Action:

// Fire when user clicks button or submits form
document.getElementById('purchase-btn').addEventListener('click', function() {
  obApi('track', 'Conversion', {
    orderValue: 99.99,
    orderId: 'ORD-12345',
    currency: 'USD'
  });
});

On Single-Page App (SPA) Navigation:

// React example: Fire on route change
useEffect(() => {
  if (location.pathname === '/order-confirmation') {
    obApi('track', 'Conversion', {
      orderValue: orderData.total,
      orderId: orderData.id,
      currency: 'USD'
    });
  }
}, [location]);

Server-Side Event Timing

  • Fire events from backend after transaction is validated and committed
  • Use server timestamp (UTC) for accurate attribution
  • Queue events for retry if API call fails to ensure delivery

Attribution Windows

Outbrain attributes conversions to campaigns based on configurable attribution windows:

  • Default: 30 days post-click, 1 day post-view
  • Custom: Can be adjusted in Amplify dashboard (7, 14, 30, 60, 90 days)

Choosing the Right Window:

  • Short sales cycle (< 7 days): Use 7 or 14 day window
  • Typical B2C ecommerce: 30 day window works well
  • Long B2B sales cycle: Consider 60 or 90 day window
  • Impulse purchases: Shorter windows prevent over-attribution

Event Deduplication

Why Deduplication Matters

  • Users may refresh confirmation pages, causing duplicate conversion fires
  • Multiple pixels or tracking methods may fire for same conversion
  • Browser back/forward navigation can re-trigger events

Deduplication Strategies

1. Unique Order IDs:

obApi('track', 'Conversion', {
  orderId: 'ORD-UNIQUE-12345',  // Outbrain deduplicates by order ID
  orderValue: 99.99,
  currency: 'USD'
});

2. Client-Side Flags:

if (!sessionStorage.getItem('conversion_tracked')) {
  obApi('track', 'Conversion', {
    orderValue: 99.99,
    orderId: 'ORD-12345',
    currency: 'USD'
  });
  sessionStorage.setItem('conversion_tracked', 'true');
}

3. Server-Side Validation:

  • Track which conversions have been sent to Outbrain in your database
  • Check before sending to avoid duplicate API calls
  • Use transaction IDs as unique keys

Conversion Value Strategies

Static Values

Assign fixed values to conversions when actual revenue is unknown or inconsistent:

// Lead form submission: always $50
obApi('track', 'Conversion', {
  orderValue: 50,
  orderId: 'LEAD-' + Date.now(),
  currency: 'USD'
});

When to Use:

  • Lead generation campaigns where revenue isn't immediate
  • Engagement events (signups, downloads) with no direct revenue
  • Simplify reporting by standardizing values

Dynamic Values

Use actual transaction amounts for precise ROI measurement:

// Pull from order data or data layer
obApi('track', 'Conversion', {
  orderValue: cart.total,
  orderId: cart.transactionId,
  currency: cart.currency
});

When to Use:

  • Ecommerce with variable order sizes
  • Subscription products with different pricing tiers
  • Accurate ROAS (Return on Ad Spend) is critical

Calculated Values

Derive values from business metrics like customer lifetime value:

// Calculate value based on subscription tier
const subscriptionValue = {
  'free': 0,
  'basic': 120,      // Annual value
  'pro': 480,
  'enterprise': 2400
};

obApi('track', 'Conversion', {
  orderValue: subscriptionValue[userTier],
  orderId: 'SUB-' + userId,
  currency: 'USD'
});

When to Use:

  • SaaS products optimizing for long-term value
  • Subscription services with predictable LTV
  • Lead valuation based on historical conversion rates

Testing & Validation

Browser Testing

  1. Open browser developer tools (F12)
  2. Navigate to Network tab
  3. Filter for outbrain or amplify.outbrain.com
  4. Trigger the event (purchase, form submit, etc.)
  5. Verify network request appears with correct parameters
  6. Check response code (should be HTTP 200)

Amplify Dashboard Validation

  1. Log in to Outbrain Amplify
  2. Navigate to Tracking & Conversions
  3. Look for recent test conversions (may take 1-2 hours to appear)
  4. Verify conversion value and parameters are correct
  5. Check attribution to specific campaigns if click-through was tracked

Data Layer Inspection

// In browser console, inspect Outbrain API queue
console.log(window.obApi.queue);

// Check what events have been tracked
window.obApi.queue.forEach(event => {
  console.log('Event:', event);
});

Common Event Tracking Patterns

Ecommerce Funnel

// 1. Product view
obApi('track', 'ProductView', {
  productId: 'PROD-123',
  productValue: 79.99
});

// 2. Add to cart
obApi('track', 'AddToCart', {
  productId: 'PROD-123',
  productValue: 79.99,
  quantity: 1
});

// 3. Checkout initiated
obApi('track', 'InitiateCheckout', {
  cartValue: 159.98,
  itemCount: 2
});

// 4. Purchase completed
obApi('track', 'Conversion', {
  orderValue: 159.98,
  orderId: 'ORD-12345',
  currency: 'USD'
});

Lead Generation Funnel

// 1. Landing page visit (base pixel auto-tracks)

// 2. Form interaction
obApi('track', 'FormStart', {
  formName: 'Contact Us',
  formType: 'Lead'
});

// 3. Form submission
obApi('track', 'Conversion', {
  orderValue: 50,
  orderId: 'LEAD-12345',
  currency: 'USD',
  leadType: 'Contact Form'
});

Content Engagement Funnel

// 1. Article view (base pixel auto-tracks)

// 2. Scroll depth
obApi('track', 'Engagement', {
  scrollDepth: 75,
  contentId: 'ARTICLE-456'
});

// 3. Newsletter signup
obApi('track', 'Conversion', {
  orderValue: 10,
  orderId: 'NL-' + Date.now(),
  currency: 'USD',
  signupType: 'Newsletter'
});

Event Tracking Checklist

  • Base pixel installed on all pages to enable audience building
  • Conversion events fire on post-conversion pages only
  • Event parameters include required fields (orderValue, currency)
  • Unique order IDs used for deduplication
  • Dynamic values pulled from data layer or backend
  • Events tested in browser developer tools
  • Test conversions appear in Amplify dashboard
  • Attribution window configured appropriately for business model
  • Custom events documented for team reference
  • Event naming conventions consistent across all tracking
  • Privacy compliance: events respect user consent settings