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

AttributeTypeRequiredDescription
api-keyStringYesAPI key for Unify requests
demoBooleanNoEnable demo mode for testing

Methods

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:

ParameterTypeRequiredDescription
eventNameStringYesEvent type (e.g. 'basket.shared', 'wishlist.shared')
eventData.user_idStringYesUser identifier
eventData.location_idStringYesLocation/store identifier
eventData.customerObjectYesCustomer data (e.g. { email })
eventData.dataObjectYesEvent-specific payload (e.g. { references, amount })

Returns: Promise — resolves with the API response, rejects with an Error on failure.


Did this page help you?