Setup & Integration

Server-Side & Hybrid Conversion Tracking

Record confirmed business outcomes through backend logic or combined tracking flows.

Server-Side Conversion Tracking

In some business scenarios, important outcome signals do not originate in the user’s browser.

Examples include:

  • payment confirmations processed by backend systems
  • subscription status changes
  • CRM or order management events
  • webhook-driven fulfilment updates

In these cases, conversions should be recorded server-side to ensure accuracy and resilience.

When to Use

Server-side tracking is recommended when:

  • conversion logic is finalised only on backend systems
  • browser tracking could be blocked by ad-blockers or consent timing
  • sensitive business events should not be exposed in client code
  • multi-system orchestration determines the real outcome

Example

TS
import { createNodeMark } from '@crelora/mark/node'

const mark = createNodeMark({
  key: process.env.MARK_SECRET_KEY,
  site_id: process.env.MARK_SITE_ID,
  site_host: process.env.MARK_SITE_HOST
})

mark.conversion('Subscription Activated', {
  order_id: 'sub_456',
  value: 4900,
  currency: 'eur'
})

In this setup:

  • conversion signals are triggered directly from trusted backend logic
  • secret keys are used instead of publishable browser keys
  • outcome data is less dependent on client-side execution conditions

Hybrid Conversion Tracking

For many modern growth environments, the most accurate approach is a hybrid model:

  • the browser records behavioural intent signals
  • the backend confirms the final business outcome
  • both signals are linked through a shared visitor identifier

Example:

Browser side:

TS
const visitorId = Mark.getVisitorId()
fetch('/api/checkout', {
  method: 'POST',
  body: JSON.stringify({
    visitor_id: visitorId,
    cart_value: 12900
  })
})

Server side:

TS
mark.conversion('Purchase Confirmed', {
  visitor_id: 'vis_abc',
  order_id: 'ord_789',
  value: 12900
})

This model allows OneLence to:

  • connect marketing attribution with verified business outcomes
  • reduce signal loss caused by browser limitations
  • support advanced revenue analytics and optimisation models

In practice, hybrid conversion tracking provides the highest level of attribution reliability.