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.
Manual form lifecycle methods. These require a form element in the DOM for fingerprinting (sh, plt, fc). A test form is included below.
User began interacting with a form
_ll.form.start({
form_id: 'sdk-test-form',
form_name: 'Contact Form',
platform: 'nat'
})
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 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 validation failed before submission
_ll.form.validationFail({
form_id: 'sdk-test-form',
form_name: 'Contact Form',
errors: [
'Email is required',
'Phone format invalid'
]
})
Manual video lifecycle and lead capture methods. Platform auto-detected if not provided.
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 playback paused by user
_ll.video.pause({
video_id: 'demo-video-001',
position_seconds: 62
})
Video reached a progress milestone
_ll.video.progress({
video_id: 'demo-video-001',
percentage: 50,
position_seconds: 120,
duration_seconds: 240
})
Video playback reached the end
_ll.video.complete({
video_id: 'demo-video-001',
position_seconds: 240,
duration_seconds: 240
})
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'
})
Manual chat widget lifecycle methods. Simulates a customer interacting with a Drift chat widget.
Chat widget opened by user
_ll.chat.widgetOpened({
platform: 'dft'
})
New conversation began
_ll.chat.started({
platform: 'dft',
conversationId: 'conv-sdk-test',
agentName: 'Sales Bot',
isBot: true
})
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
})
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
})
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'
})
Conversation ended or completed
_ll.chat.ended({
platform: 'dft',
conversationId: 'conv-sdk-test',
durationMs: 180000,
messageCount: 8
})
Chat widget closed by user (emits same event as ended)
_ll.chat.widgetClosed({
platform: 'dft'
})
Manual scheduling widget methods. Simulates Calendly-style booking flow.
Scheduling widget loaded on page
_ll.scheduling.loaded({
platform: 'cal',
typeId: 'discovery-call',
typeName: '30 Min Discovery Call'
})
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'
})
All 15 ecommerce SDK methods. Browsing, cart, checkout, transactions, promotions, wishlist, and subscriptions.
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'
})
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'
)
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'
)
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'
})
Item removed from shopping cart
_ll.ecommerce.removeFromCart({
item_id: 'SKU-001',
item_name: 'Pro Widget',
price: 49.99,
quantity: 1,
currency: 'USD'
})
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'
)
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 }
]
})
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 }
]
})
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 }
]
})
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' }
]
})
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 }
]
})
Subscription cancelled
_ll.ecommerce.cancelSubscription({
subscription_id: 'SUB-12345',
reason: 'Too expensive',
effective_date: '2026-05-01'
})
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'
})
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'
})
Item added to wishlist
_ll.ecommerce.addToWishlist({
currency: 'USD',
value: 79.99,
items: [
{ item_id: 'SKU-002', item_name: 'Super Gadget', price: 79.99 }
]
})
Explicit person identification. Highest confidence (1.0). Emits id event, not pp. Multiple variants showing different field combinations.
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'
})
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'
}
})
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'
}
})
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
}
})
Track any business-specific event via _ll.track(). Parameters must be flat key-value pairs.
Simple custom event with no parameters
_ll.track('button_clicked')
Custom event with flat key-value parameters
_ll.track('feature_used', {
feature: 'export',
format: 'csv',
row_count: 1500,
is_premium: true,
user_segment: 'enterprise'
})