Manual SDK Methods Test Suite

Every manual SDK method in one page. Each button fires a real SDK call with realistic data. Use with the Preview Viewer to validate event emission and edge processing.

Categories (40 methods)

Forms (4) Video (5) Chat (7) Scheduling (2) Ecommerce (15) Identity (4) Custom Events (2)

Forms

Manual form lifecycle methods. These require a form element in the DOM for fingerprinting (sh, plt, fc). A test form is included below.

form.start() fs

User began interacting with a form

_ll.form.start({
  form_id: 'sdk-test-form',
  form_name: 'Contact Form',
  platform: 'nat'
})

form.step() fsc

Multi-step form progressed to next step

_ll.form.step({
  form_id: 'sdk-test-form',
  form_name: 'Contact Form',
  step: 2,
  total_steps: 3,
  step_name: 'Company Info'
})

form.submit() fsu

Form was submitted with field data and identity

_ll.form.submit({
  form_id: 'sdk-test-form',
  form_name: 'Contact Form',
  duration: 45000,
  field_count: 4,
  fields: {
    email: 'form-lead@acmecorp.io',
    first_name: 'Form',
    last_name: 'Lead',
    phone: '+1-555-111-2222'
  }
})

form.validationFail() fvf

Form validation failed before submission

_ll.form.validationFail({
  form_id: 'sdk-test-form',
  form_name: 'Contact Form',
  errors: [
    'Email is required',
    'Phone format invalid'
  ]
})

Video

Manual video lifecycle and lead capture methods. Platform auto-detected if not provided.

video.play() vpl

Video playback started or resumed

_ll.video.play({
  video_id: 'demo-video-001',
  title: 'Product Overview',
  platform: 'yt',
  duration_seconds: 240,
  position_seconds: 0
})

video.pause() vpa

Video playback paused by user

_ll.video.pause({
  video_id: 'demo-video-001',
  position_seconds: 62
})

video.progress() vpg

Video reached a progress milestone

_ll.video.progress({
  video_id: 'demo-video-001',
  percentage: 50,
  position_seconds: 120,
  duration_seconds: 240
})

video.complete() ven

Video playback reached the end

_ll.video.complete({
  video_id: 'demo-video-001',
  position_seconds: 240,
  duration_seconds: 240
})

video.lead() vle + pp

Lead captured from video gate/turnstile. Also emits possible_person.

_ll.video.lead({
  platform: 'wis',
  video_id: 'gated-webinar-2024',
  title: 'Enterprise Security Webinar',
  email: 'video-lead@acmecorp.io',
  firstName: 'Video',
  lastName: 'Viewer',
  phone: '+1-555-333-4444'
})

Chat

Manual chat widget lifecycle methods. Simulates a customer interacting with a Drift chat widget.

chat.widgetOpened() cho

Chat widget opened by user

_ll.chat.widgetOpened({
  platform: 'dft'
})

chat.started() chs

New conversation began

_ll.chat.started({
  platform: 'dft',
  conversationId: 'conv-sdk-test',
  agentName: 'Sales Bot',
  isBot: true
})

chat.messageSent() cms

User sent a message to agent/bot

_ll.chat.messageSent({
  platform: 'dft',
  conversationId: 'conv-sdk-test',
  messageText: 'Can you tell me about pricing?',
  messageIndex: 1
})

chat.messageReceived() cmr

Agent or bot sent a message to user

_ll.chat.messageReceived({
  platform: 'dft',
  conversationId: 'conv-sdk-test',
  agentName: 'Sarah Chen',
  isBot: false,
  messageText: 'Our Pro plan starts at $99/mo.',
  messageIndex: 2
})

chat.emailCaptured() cec + pp

Email captured during chat. Also emits possible_person.

_ll.chat.emailCaptured({
  platform: 'dft',
  email: 'chat-lead@acmecorp.io',
  firstName: 'Chat',
  lastName: 'Lead',
  phone: '+1-555-867-5309',
  conversationId: 'conv-sdk-test'
})

chat.ended() che

Conversation ended or completed

_ll.chat.ended({
  platform: 'dft',
  conversationId: 'conv-sdk-test',
  durationMs: 180000,
  messageCount: 8
})

chat.widgetClosed() che

Chat widget closed by user (emits same event as ended)

_ll.chat.widgetClosed({
  platform: 'dft'
})

Scheduling

Manual scheduling widget methods. Simulates Calendly-style booking flow.

scheduling.loaded() sld

Scheduling widget loaded on page

_ll.scheduling.loaded({
  platform: 'cal',
  typeId: 'discovery-call',
  typeName: '30 Min Discovery Call'
})

scheduling.scheduled() sch + pp

Meeting booked. Also emits possible_person when email provided.

_ll.scheduling.scheduled({
  platform: 'cal',
  scheduledTime: '',
  duration: 30,
  assignee: 'Sales Team',
  bookingId: '',
  typeId: 'discovery-call',
  typeName: '30 Min Discovery Call',
  email: 'booking@acmecorp.io',
  firstName: 'Booking',
  lastName: 'Lead',
  phone: '+1-555-999-0000'
})

Ecommerce

All 15 ecommerce SDK methods. Browsing, cart, checkout, transactions, promotions, wishlist, and subscriptions.

ecommerce.viewItem() evi

User viewed a product detail page

_ll.ecommerce.viewItem({
  item_id: 'SKU-001',
  item_name: 'Pro Widget',
  price: 49.99,
  item_brand: 'Acme',
  item_category: 'Widgets',
  currency: 'USD'
})

ecommerce.viewItemList() eil

User viewed a list of products

_ll.ecommerce.viewItemList(
  [
    { item_id: 'SKU-001', item_name: 'Pro Widget', price: 49.99 },
    { item_id: 'SKU-002', item_name: 'Super Gadget', price: 79.99 },
    { item_id: 'SKU-003', item_name: 'Mega Gizmo', price: 129.99 }
  ],
  'cat-widgets',
  'Widget Collection'
)

ecommerce.selectItem() esi

User clicked a product from a list

_ll.ecommerce.selectItem(
  { item_id: 'SKU-002', item_name: 'Super Gadget', price: 79.99 },
  'cat-widgets',
  'Widget Collection'
)

ecommerce.addToCart() atc

Item added to shopping cart

_ll.ecommerce.addToCart({
  item_id: 'SKU-001',
  item_name: 'Pro Widget',
  price: 49.99,
  quantity: 2,
  item_brand: 'Acme',
  currency: 'USD'
})

ecommerce.removeFromCart() rfc

Item removed from shopping cart

_ll.ecommerce.removeFromCart({
  item_id: 'SKU-001',
  item_name: 'Pro Widget',
  price: 49.99,
  quantity: 1,
  currency: 'USD'
})

ecommerce.viewCart() eca

User viewed their cart

_ll.ecommerce.viewCart(
  [
    { item_id: 'SKU-001', item_name: 'Pro Widget', price: 49.99, quantity: 2 },
    { item_id: 'SKU-003', item_name: 'Mega Gizmo', price: 129.99, quantity: 1 }
  ],
  'USD'
)

ecommerce.beginCheckout() eco

User started checkout process

_ll.ecommerce.beginCheckout({
  currency: 'USD',
  value: 229.97,
  coupon: 'SUMMER20',
  items: [
    { item_id: 'SKU-001', item_name: 'Pro Widget', price: 49.99, quantity: 2 },
    { item_id: 'SKU-003', item_name: 'Mega Gizmo', price: 129.99, quantity: 1 }
  ]
})

ecommerce.addShippingInfo() esh

User added shipping information

_ll.ecommerce.addShippingInfo({
  currency: 'USD',
  value: 229.97,
  shipping_tier: 'Express',
  items: [
    { item_id: 'SKU-001', item_name: 'Pro Widget', price: 49.99, quantity: 2 }
  ]
})

ecommerce.addPaymentInfo() epi

User added payment information

_ll.ecommerce.addPaymentInfo({
  currency: 'USD',
  value: 229.97,
  payment_type: 'credit_card',
  items: [
    { item_id: 'SKU-001', item_name: 'Pro Widget', price: 49.99, quantity: 2 }
  ]
})

ecommerce.purchase() epu

Purchase completed

_ll.ecommerce.purchase({
  transaction_id: 'ORD-SDK-' + Date.now().toString(36).toUpperCase(),
  currency: 'USD',
  value: 229.97,
  tax: 18.40,
  shipping: 9.99,
  coupon: 'SUMMER20',
  items: [
    { item_id: 'SKU-001', item_name: 'Pro Widget', price: 49.99, quantity: 2, item_brand: 'Acme' },
    { item_id: 'SKU-003', item_name: 'Mega Gizmo', price: 129.99, quantity: 1, item_brand: 'Acme' }
  ]
})

ecommerce.refund() erf

Refund processed (item-level)

_ll.ecommerce.refund({
  transaction_id: 'ORD-SDK-REFUND',
  currency: 'USD',
  reason: 'Customer returned item',
  items: [
    { item_id: 'SKU-001', item_name: 'Pro Widget', price: 49.99, quantity: 1 }
  ]
})

ecommerce.cancelSubscription() esc

Subscription cancelled

_ll.ecommerce.cancelSubscription({
  subscription_id: 'SUB-12345',
  reason: 'Too expensive',
  effective_date: '2026-05-01'
})

ecommerce.viewPromotion() epr

User viewed a promotional banner

_ll.ecommerce.viewPromotion({
  promotion_id: 'PROMO-SUMMER',
  promotion_name: 'Summer Sale 2026',
  creative_name: 'Hero Banner',
  creative_slot: 'homepage_top'
})

ecommerce.selectPromotion() eps

User clicked a promotional banner

_ll.ecommerce.selectPromotion({
  promotion_id: 'PROMO-SUMMER',
  promotion_name: 'Summer Sale 2026',
  creative_name: 'Hero Banner',
  creative_slot: 'homepage_top'
})

ecommerce.addToWishlist() ewl

Item added to wishlist

_ll.ecommerce.addToWishlist({
  currency: 'USD',
  value: 79.99,
  items: [
    { item_id: 'SKU-002', item_name: 'Super Gadget', price: 79.99 }
  ]
})

Identity

Explicit person identification. Highest confidence (1.0). Emits id event, not pp. Multiple variants showing different field combinations.

identifyPerson() - Basic id

Simple identification with name and company string

_ll.identifyPerson({
  email: 'basic@acmecorp.io',
  firstName: 'Basic',
  lastName: 'User',
  phone: '+1-555-777-8888',
  company: 'Acme Corp',
  title: 'VP of Marketing'
})

identifyPerson() - Company Object id

Company as structured object with domain for company reveal

_ll.identifyPerson({
  email: 'enterprise@bigcorp.com',
  firstName: 'Enterprise',
  lastName: 'Buyer',
  phone: '+1-555-222-3333',
  jobTitle: 'Director of Engineering',
  company: {
    domain: 'bigcorp.com',
    name: 'BigCorp International'
  }
})

identifyPerson() - Full Address id

Complete identity with address, external ID, and all fields

_ll.identifyPerson({
  email: 'full@acmecorp.io',
  firstName: 'Full',
  lastName: 'Profile',
  phone: '+1-555-444-5555',
  jobTitle: 'CTO',
  city: 'San Francisco',
  state: 'CA',
  country: 'US',
  postalCode: '94105',
  address: '123 Market Street',
  address2: 'Suite 400',
  externalId: 'CRM-12345',
  company: {
    domain: 'acmecorp.io',
    name: 'Acme Corporation'
  }
})

identifyPerson() - Custom Fields id

Identity with custom business-specific fields

_ll.identifyPerson({
  email: 'custom@startup.io',
  firstName: 'Custom',
  lastName: 'Fields',
  company: 'TechStartup Inc',
  customFields: {
    plan: 'enterprise',
    account_tier: 'premium',
    signup_date: '2026-01-15',
    lifetime_value: 5000,
    is_trial: false
  }
})

Custom Events

Track any business-specific event via _ll.track(). Parameters must be flat key-value pairs.

track() - Basic cus

Simple custom event with no parameters

_ll.track('button_clicked')

track() - With Parameters cus

Custom event with flat key-value parameters

_ll.track('feature_used', {
  feature: 'export',
  format: 'csv',
  row_count: 1500,
  is_premium: true,
  user_segment: 'enterprise'
})