Setup & Integration

Visitor Identity & Attribution Continuity

Connect browser activity and backend outcomes through consistent identifiers.

In OneLence, attribution continuity depends on the ability to associate multiple events with the same visitor or user across sessions, devices, and tracking environments.

The SDK manages this through a pseudonymous visitor identifier and optional user identification signals.

Visitor Identifier Concept

When the browser SDK initializes, it generates or retrieves a pseudonymous visitor ID.

This identifier allows OneLence to connect:

  • page views
  • behavioural events
  • marketing attribution parameters
  • conversion signals

within the same journey context.

Key characteristics:

  • visitor IDs are SDK-scoped and first-party controlled
  • they persist according to consent configuration
  • they are automatically attached to tracked events

Developers can access the current visitor identifier when needed:

TS
const visitorId = Mark.getVisitorId()

This value can be sent to backend systems to enable server-side attribution joining.

Use Visitor ID for Server-Side Attribution

When backend events occur outside the browser session, such as payment confirmations or webhook processing, the visitor ID can be passed from frontend to server.

Example flow:

Browser:

TS
const visitorId = Mark.getVisitorId()

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

Server:

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

This mechanism allows OneLence to link:

  • marketing acquisition signals
  • user journey behaviour
  • backend-validated conversion outcomes

into a single attribution model.

User Identification Signals

In addition to visitor identifiers, developers can associate known user identities with prior anonymous activity.

Example:

TS
Mark.identify('user_123', {
  email: '[email protected]',
  language: 'en-US'
})

This enables:

  • lifecycle attribution across login boundaries
  • cross-device journey continuity
  • segmentation and retention analysis

User traits are processed with privacy safeguards and cannot override reserved tracking fields.

Attribution Continuity Considerations

To maintain reliable attribution flows:

  • send visitor identifiers to backend systems when server-side conversions are expected
  • use consistent event naming across browser and server tracking
  • trigger identify() when authentication state becomes available
  • ensure consent configuration aligns with persistence requirements

Correct identity handling ensures that attribution insights remain stable as tracking complexity increases.