Conversion & Attribution Tracking

Track revenue with full UTM attribution, multi-touch journey tracking, and automatic deduplication

5
UTM Parameters
โˆž
Multi-Touch
Auto
Deduplication
Cross
Device Tracking
0
Config Required

๐Ÿ”„ Attribution Flow

๐Ÿ”—UTM Capture
User clicks ad
UTM params extracted
๐Ÿ“ฑDevice Attribution
Stored per device
Anonymous tracking
๐Ÿ‘คUser Attribution
On identify()
Cross-device merge
๐Ÿ’ตConversion
UTM snapshot
Revenue tracked

๐Ÿ’ป Code Examples

1. Simple Product Event

Track any product interaction without revenue

// Track a product view or interaction
Claymore.push('event', ['product_viewed', {
  productId: 'PROD-123',
  productName: 'Premium Plan',
  productCategory: 'subscription'
}]);

2. Simple Conversion (Purchase)

Track a purchase with automatic UTM attribution

// Track a purchase - UTM attribution is automatic!
Claymore.push('event', ['purchase', {
  orderId: 'ORD-12345',           // Required: unique order ID
  productId: 'PROD-PREMIUM',      // Required: product identifier
  productName: 'Premium Plan',
  totalAmount: 99.99,             // Revenue (after any discounts)
  currency: 'USD',
  isPrimarySale: true             // First purchase = true
}]);

3. Complex Conversion (Multi-Product with Discount)

Track detailed conversion with product metadata, quantity, and coupon

// Full conversion tracking with all fields
Claymore.push('event', ['purchase', {
  orderId: 'ORD-67890',
  productId: 'PROD-STORAGE',
  productName: 'Extra Storage Pack',
  productCategory: 'addon',
  quantity: 2,
  unitPrice: 9.99,                // Price per unit
  totalAmount: 17.98,             // Actual payment: (9.99 ร— 2) - 2.00
  currency: 'USD',
  discountAmount: 2.00,           // Discount applied
  couponCode: 'SAVE10',           // Promo code used
  isPrimarySale: false            // Repeat purchase
}]);

4. Backend/Server-Side Event

Track conversions from your server (webhooks, payment processors)

// Server-side: POST to /sdk/ingest
curl -X POST https://api.claymore.one/sdk/ingest \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "your-project-uuid",
    "deviceId": "device-uuid-from-cookie",
    "source": "backend",
    "externalUserId": "user@example.com",
    "events": [{
      "name": "purchase",
      "orderId": "ORD-STRIPE-001",
      "productId": "PROD-ENTERPRISE",
      "totalAmount": 999.00,
      "currency": "USD",
      "isPrimarySale": true,
      "timestamp": 1705600000000
    }]
  }'

5. Custom Data via Payload

Add any custom fields using the payload object

// Use payload for any custom data
Claymore.push('event', ['purchase', {
  orderId: 'ORD-12345',
  productId: 'PROD-PREMIUM',
  totalAmount: 299.99,
  currency: 'USD',
  
  // payload accepts any key-value pairs
  payload: {
    gclid: 'EAIaIQobChMI...',     // e.g. Google Click ID
    region: 'EMEA',               // custom field
    salesAgent: 'john.doe',       // custom field
    experimentVariant: 'B'        // custom field
  }
}]);

6. A/B Test Conversion Tracking

Register experiment variants and track conversions by A/B test

// 1. Register experiment variants for this session
Claymore.push('identifyExperiment', [[
  { id: 'exp_checkout_button', variant: 'blue_cta' },
  { id: 'exp_pricing_page', variant: 'control' }
]]);

// 2. Track conversion - automatically linked to experiments
// Note: In browser, SDK includes sessionId automatically.
// For backend events, you must pass sessionId explicitly.
Claymore.push('event', ['purchase', {
  orderId: 'ORD-12345',
  productId: 'PROD-PREMIUM',
  totalAmount: 99.99,
  currency: 'USD'
}]);

// Query experiment results in SQL Explorer:
// SELECT se.experimentId, se.variant, count(*) as conversions
// FROM events e
// JOIN session_experiments se ON e.sessionId = se.sessionId
// WHERE e.name = 'purchase'
// GROUP BY se.experimentId, se.variant

7. Historical Import with UTM Attribution

Import data with explicit UTM parameters (overrides automatic attribution)

// Import with explicit UTM attribution
curl -X POST https://api.claymore.one/sdk/ingest \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "your-project-uuid",
    "deviceId": "imported-device-uuid",
    "source": "import",
    "externalUserId": "customer-456",
    "events": [{
      "name": "purchase",
      "orderId": "HIST-ORD-2023-456",
      "productId": "UNIT-A501",
      "totalAmount": 850000,
      "currency": "AED",
      "timestamp": 1698850000000,
      
      "utmSource": "youtube",
      "utmMedium": "influencer",
      "utmCampaign": "summer_2023"
    }]
  }'

8. Custom Data via Payload

Add any custom fields using the payload object

// Use payload for arbitrary custom data
curl -X POST https://api.claymore.one/sdk/ingest \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "your-project-uuid",
    "deviceId": "imported-device-uuid",
    "source": "import",
    "externalUserId": "customer-456",
    "events": [{
      "name": "purchase",
      "orderId": "HIST-ORD-2023-456",
      "productId": "UNIT-A501",
      "totalAmount": 850000,
      "currency": "AED",
      
      "payload": {
        "gclid": "CjwKCAiA...",
        "partnerRef": "REF-001",
        "leadSource": "property_finder"
      }
    }]
  }'

๐Ÿ† Competitor Comparison

FeatureClaymoreGA4MixpanelAmplitudeSegment
Session Replay + Conversionโœ“ Integratedโœ— No replayโœ— No replayโœ— No replayโœ— No replay
Multi-Touch Attributionโœ“ Full journeyLimitedโœ“ Yesโœ“ Yesโœ“ Yes
Cross-Device Trackingโœ“ Auto-mergeUser-ID req.โœ“ Yesโœ“ Yesโœ“ Yes
Built-in Deduplicationโœ“ Automaticโœ— Manualโœ— Manualโœ— Manualโœ— Manual
Self-Hosted Optionโœ“ Full controlโœ— Google onlyโœ— SaaS onlyโœ— SaaS onlyโœ— SaaS only
Backend Eventsโœ“ Nativeโœ“ Measurement Protocolโœ“ Yesโœ“ Yesโœ“ Yes
Watch WHY Users Convertโœ“ Replay linkedโœ— Numbers onlyโœ— Numbers onlyโœ— Numbers onlyโœ— Numbers only
Data Ownershipโœ“ 100% yoursGoogle'sSharedSharedShared
Zero Config Attributionโœ“ AutomaticSetup neededSetup neededSetup neededSetup needed

๐Ÿ“Š UTM Parameters Tracked

utm_source

Where traffic comes from

facebook, google, newsletter

utm_medium

How it came (channel type)

cpc, email, social, banner

utm_campaign

Which campaign

summer_sale, black_friday

utm_term

Search keyword (paid search)

buy shoes, cheap laptops

utm_content

Ad variant (A/B testing)

blue_button, video_30s

๐Ÿ“ฆ Custom Data via Payload

The payload field accepts any JSON object. Use it to store custom data that doesn't fit the standard schema.

Advertising IDs

gclid, fbclid, campaign IDs

Partner Data

referenceId, agentCode, leadSource

Custom Attributes

region, tier, experiment variant

Anything Else

Any key-value pairs you need

๐Ÿ“‹ What We Have & What's Coming

โœ… Available Now

  • Full UTM tracking (all 5 parameters)
  • Multi-touch attribution per device
  • Cross-device tracking via user identity
  • Automatic deduplication (orderId:productId)
  • Backend/server-side events
  • Product metadata (category, quantity, price)
  • Discount & coupon tracking
  • Primary vs secondary sale tracking
  • Session replay linked to conversions

๐Ÿš€ Coming Soon

  • Revenue dashboards in UI
  • Funnel visualization with conversion rates
  • First-touch attribution option
  • Attribution window configuration
  • Multi-touch attribution models (linear, time-decay)
  • Cohort analysis by campaign
  • Revenue alerts and thresholds
  • Export to CSV/BI tools

๐Ÿ’ก The Claymore Difference

GA4 tells you: โ€œYou had 150 conversions from Facebook campaign.โ€

Claymore shows you: The actual user journey โ€” watch the session replay of any conversion, see exactly what the user experienced, understand WHY they converted (or didn't).

Numbers tell you WHAT happened. Replays show you WHY.