Conversion & Attribution Tracking
Track revenue with full UTM attribution, multi-touch journey tracking, and automatic deduplication
๐ Attribution Flow
UTM params extracted
Anonymous tracking
Cross-device merge
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.variant7. 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
| Feature | Claymore | GA4 | Mixpanel | Amplitude | Segment |
|---|---|---|---|---|---|
| Session Replay + Conversion | โ Integrated | โ No replay | โ No replay | โ No replay | โ No replay |
| Multi-Touch Attribution | โ Full journey | Limited | โ Yes | โ Yes | โ Yes |
| Cross-Device Tracking | โ Auto-merge | User-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% yours | Google's | Shared | Shared | Shared |
| Zero Config Attribution | โ Automatic | Setup needed | Setup needed | Setup needed | Setup needed |
๐ UTM Parameters Tracked
utm_source
Where traffic comes from
facebook, google, newsletterutm_medium
How it came (channel type)
cpc, email, social, bannerutm_campaign
Which campaign
summer_sale, black_fridayutm_term
Search keyword (paid search)
buy shoes, cheap laptopsutm_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 IDsPartner Data
referenceId, agentCode, leadSourceCustom Attributes
region, tier, experiment variantAnything 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.