Event Sending
Basic Event Sending
Use the HandL.sendTikTokEvent() function to send events to TikTok:
HandL.sendTikTokEvent(eventName, eventData);
Parameters:
eventName(string, required): The name of the eventeventData(object, optional): Event properties and parameters
Note: TikTok Pixel only supports one payload parameter (unlike Facebook which supports two).
Standard Events
TikTok supports the following standard events:
PageView
Automatically fired on page load. You can also manually trigger it:
HandL.sendTikTokEvent('PageView');
Purchase
Track completed purchases:
HandL.sendTikTokEvent('Purchase', {
value: 29.99,
currency: 'USD',
content_type: 'product',
content_id: 'SKU123',
quantity: 1
});
CompleteRegistration
Track when users complete registration:
HandL.sendTikTokEvent('CompleteRegistration', {
content_name: 'Account Registration',
status: true
});
AddToCart
Track when items are added to cart:
HandL.sendTikTokEvent('AddToCart', {
value: 19.99,
currency: 'USD',
content_type: 'product',
content_id: 'SKU456',
quantity: 1
});
InitiateCheckout
Track when checkout process begins:
HandL.sendTikTokEvent('InitiateCheckout', {
value: 49.99,
currency: 'USD',
contents: [
{
content_id: 'SKU123',
content_name: 'Product Name',
quantity: 1,
price: 29.99
}
]
});
ViewContent
Track when users view content:
HandL.sendTikTokEvent('ViewContent', {
content_type: 'product',
content_id: 'SKU789',
content_name: 'Product Name',
value: 99.99,
currency: 'USD'
});
Search
Track search queries:
HandL.sendTikTokEvent('Search', {
search_string: 'running shoes',
content_type: 'product'
});
Contact
Track contact form submissions:
HandL.sendTikTokEvent('Contact', {
content_name: 'Contact Form',
content_category: 'Lead Generation'
});
Subscribe
HandL.sendTikTokEvent('Subscribe', {
content_name: 'Newsletter',
content_category: 'Email Marketing'
});
Lead
Track lead generation events:
HandL.sendTikTokEvent('Lead', {
content_name: 'Lead Form',
value: 0,
currency: 'USD'
});
Custom Events
You can also send custom events with any event name:
HandL.sendTikTokEvent('CustomEventName', {
custom_parameter: 'value',
another_param: 123
});
Event Data Parameters
Common event parameters you can include:
| Parameter | Type | Description | Example |
|---|---|---|---|
value |
number | Monetary value of the event | 29.99 |
currency |
string | Currency code (ISO 4217) | 'USD', 'EUR' |
content_type |
string | Type of content | 'product', 'video' |
content_id |
string | Unique identifier for content | 'SKU123' |
content_name |
string | Name of the content | 'Product Name' |
content_category |
string | Category of content | 'Electronics' |
quantity |
number | Quantity of items | 2 |
contents |
array | Array of content items | See example above |