Event Tracker
Track customer interactions in real-time for analytics and reporting.
For installation instructions, see Getting Started with Unify Widgets.
Basic Implementation
<unify-event-tracker-widget api-key="your-api-key"></unify-event-tracker-widget>Component Attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
api-key | String | Yes | API key for Unify requests |
demo | Boolean | No | Enable demo mode for testing |
Methods
event(eventName, eventData)
event(eventName, eventData)Send a tracking event to the Unify API. Returns a Promise.
const tracker = document.querySelector('unify-event-tracker-widget');
await tracker.event('basket.shared', {
user_id: 'user-uuid',
location_id: 'location-uuid',
customer: {
email: '[email protected]'
},
data: {
references: 'REF001',
amount: '150.00'
}
});Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
eventName | String | Yes | Event type (e.g. 'basket.shared', 'wishlist.shared') |
eventData.user_id | String | Yes | User identifier |
eventData.location_id | String | Yes | Location/store identifier |
eventData.customer | Object | Yes | Customer data (e.g. { email }) |
eventData.data | Object | Yes | Event-specific payload (e.g. { references, amount }) |
Returns: Promise — resolves with the API response, rejects with an Error on failure.
Updated 3 months ago
Did this page help you?