Skip to main content

Conversion Destinations

Analytics

Forward analytics events to ad platforms (Google Ads, Meta, TikTok) for conversion tracking and attribution.

Auto Click ID Capture

Automatically captures gclid, fbclid, ttclid from URL

Server-Side Tracking

Bypasses ad blockers for reliable attribution

Auto User Enrichment

User data from auth state included automatically

Auto Hashing

PII data hashed with SHA-256 before sending

Overview

Conversion Destinations is a CDP (Customer Data Platform) feature built into Analytics. Forward events to Google Ads, Meta (Facebook), and TikTok with a single API call.

How it works
track('purchase', { value: 99.99 })Analytics Service
       ↓
  ┌────┴────┐
  ↓         ↓
Internal   Destinations
Storage    ├── Google Ads Offline Conversions
           ├── Meta Conversions API
           └── TikTok Events API

Why Server-Side?

Server-side conversion tracking bypasses ad blockers, improves attribution accuracy, and enables enhanced conversions with user data matching.

Quick Start

The SDK automatically captures click IDs and enriches conversion data. Just track events:

Basic Usage (Auto-Enriched)
import { useAnalytics } from '@sylphx/sdk/react'

function CheckoutSuccess({ order }) {
  const { track } = useAnalytics()

  useEffect(() => {
    // Click IDs (gclid, fbclid, ttclid) are auto-captured from URL
    // User data (email, name) is auto-enriched from auth state
    track('purchase', {
      value: order.total,
      orderId: order.id,
    }, {
      destinations: ['google_ads', 'meta'],
      conversion: {
        value: order.total,
        currency: 'USD',
        orderId: order.id,
        // clickId, userEmail, userFirstName, userLastName
        // are all automatically included!
      }
    })
  }, [order])

  return <div>Thank you!</div>
}

Zero Configuration

Click IDs are automatically captured when users land from ads and stored for 90 days. User data from your auth state is automatically included in conversion data.

useConversionTracking Hook

Use the dedicated useConversionTracking hook for the cleanest conversion tracking:

Recommended Approach
import { useConversionTracking } from '@sylphx/sdk/react'

function CheckoutSuccess({ order }) {
  const { trackConversion, clickIds, primaryClickId } = useConversionTracking()

  useEffect(() => {
    // Simplest conversion tracking - auto-enriched with click IDs and user data
    trackConversion('purchase', {
      value: order.total,
      currency: 'USD',
      orderId: order.id,
    })
  }, [order])

  // Optional: Check if user came from ads
  if (primaryClickId) {
    console.log('User came from ad campaign')
  }

  return <div>Thank you!</div>
}
PropertyTypeDescription
trackConversionfunctionTrack conversion event with auto-enrichment
clickIdsClickIdsAuto-captured click IDs { gclid?, fbclid?, ttclid? }
primaryClickIdstring | undefinedFirst available click ID (gclid > fbclid > ttclid)

Auto-Capture & Enrichment

Click ID Auto-Capture

When the SylphxProvider mounts, it automatically:

  • Captures gclid (Google Ads) from URL
  • Captures fbclid (Meta/Facebook) from URL
  • Captures ttclid (TikTok) from URL
  • Stores click IDs in localStorage with 90-day expiry

Auto-Enrichment

When you include conversion data in a track() call, the SDK automatically adds:

PropertyTypeDescription
clickIdautoPrimary click ID (gclid > fbclid > ttclid)
userEmailautoFrom authenticated user state
userFirstNameautoParsed from user name
userLastNameautoParsed from user name

Override Auto-Enrichment

You can always override auto-enriched values by explicitly passing them in the conversion object.

Manual Control

For advanced use cases, you can override auto-enrichment or specify exact destinations:

Full Control
import { useAnalytics } from '@sylphx/sdk/react'

const { track } = useAnalytics()

// Override auto-enriched values
track('purchase', {
  value: 99.99,
  orderId: 'ORDER-123',
}, {
  destinations: ['google_ads'],  // Only forward to Google Ads
  conversion: {
    clickId: customClickId,      // Override auto-captured click ID
    userEmail: customEmail,       // Override auth state email
    userPhone: '+1234567890',     // Add phone (not in auth state)
    value: 99.99,
    currency: 'USD',
    orderId: 'ORDER-123',
  }
})

// Skip destinations entirely
track('internal_event', { data: '...' }, {
  skipDestinations: true
})
useConversionTracking with Options
const { trackConversion } = useConversionTracking()

// Override auto-enrichment and specify destinations
trackConversion('purchase', {
  value: 99.99,
  currency: 'USD',
  orderId: 'ORDER-123',
}, {
  clickId: customClickId,         // Override click ID
  userEmail: customEmail,          // Override email
  destinations: ['google_ads'],    // Only forward to these destinations
})

Supported Platforms

Google Ads

Send offline conversions to Google Ads for better attribution and smart bidding optimization.

Google Ads Setup (Dashboard)
Required credentials:Client ID (OAuth)Client SecretRefresh TokenCustomer ID (e.g., 123-456-7890)Conversion Action ID

Meta (Facebook)

Send events to Meta Conversions API for improved tracking and lookalike audiences.

Meta Setup (Dashboard)
Required credentials:System User Access TokenPixel ID

TikTok

Send events to TikTok Events API for conversion tracking and optimization.

TikTok Setup (Dashboard)
Required credentials:Access TokenPixel Code

Conversion Data Reference

All conversion data fields. Auto-enriched fields are marked:

PropertyTypeDescription
clickIdstring (auto)Ad platform click ID - auto-captured from URL
valuenumberConversion value (e.g., purchase amount)
currencystringISO 4217 currency code (e.g., USD)
orderIdstringUnique order/transaction ID
userEmailstring (auto)User email - auto-enriched from auth state, SHA-256 hashed
userPhonestringUser phone - must be provided, SHA-256 hashed
userFirstNamestring (auto)First name - auto-enriched from user name, SHA-256 hashed
userLastNamestring (auto)Last name - auto-enriched from user name, SHA-256 hashed

Privacy

User data (email, phone, names) is automatically SHA-256 hashed before sending to ad platforms. This is required by all major ad platforms for enhanced conversions.

Auto-Forward Configuration

Configure destinations to auto-forward specific events without explicit destination params:

Dashboard Configuration
Destination: Google Ads
├── Auto-forward:Enabled
├── Event filter: purchase, signup, add_to_cart
└── All events matching filter are forwarded automatically
SDK Usage
// With auto-forward configured, this automatically goes to destinations
// Click IDs and user data are auto-enriched
track('purchase', {
  value: 99.99,
  orderId: 'ORDER-123',
})

// Skip auto-forward for specific events
track('internal_event', { data: '...' }, {
  skipDestinations: true  // Won't forward to any destination
})

Built-in Auto-Tracking

The SDK automatically tracks key conversion events with destination support:

PropertyTypeDescription
$signupautoTracked on user registration with conversion data
$purchaseautoTracked on subscription checkout with value and orderId

These auto-tracked events include conversion data and are forwarded to any configured auto-forward destinations.

Delivery Logs

Monitor destination delivery status in your app dashboard:

PropertyTypeDescription
pendingstatusEvent queued for delivery
sentstatusRequest sent to platform
deliveredstatusPlatform confirmed receipt
failedstatusDelivery failed (can retry)

Failed deliveries can be retried from the dashboard. View detailed error messages and platform responses for debugging.

Best Practices

Use the SylphxProvider Early

Mount SylphxProvider at your app root to capture click IDs on first page load.

Let Auto-Enrichment Work

Don't manually capture click IDs or pass user data - the SDK handles this automatically. Only override when you have a specific reason.

Use Unique Order IDs

Always include order IDs to enable deduplication. Platforms use this to prevent double-counting.

Monitor Delivery Rates

Check delivery logs regularly. Low success rates usually indicate credential issues or misconfigured conversion actions.

Pricing

Destination forwarding is billed separately from analytics events:

PropertyTypeDescription
Analytics Events$0.50 / 10KStorage and dashboards (10K free/month)
Destination Forwards$0.10 / 1KPer destination (100 free/month per destination)

Example

100K events tracked + 10K forwards to Google Ads + 10K forwards to Meta = $4.50 + $0.90 + $0.90 = $6.30/month