Track your own events
Send events from your website, such as an order placed, and start workflows from them.
A custom event is something that happens on your website that Prativani can’t see by itself, such as “order placed” or “trial started”. Send it from your website, and a workflow can react to it.
Before you start
- The web messenger is installed on your website, kept in a variable. See Verify logged-in visitors for how.
Send an event
Section titled “Send an event”Call trackEvent with a name and any details you want to keep:
<script> widget.trackEvent('order_placed', { orderId: '48291', value: 1240, currency: 'INR', });</script>widget is the web messenger you created with new SupportWidget(...). Event names can use letters, numbers, dots, dashes and underscores, up to 100 characters. Details can be up to 4 KB, and each visitor can send up to 30 events a minute.
You don’t need to set anything up first. An event appears on the Custom Events page the first time it’s sent.
See your events
Section titled “See your events”Go to Workflows›Custom Events. Each event shows when it was Last seen, how many arrived in the last 30 days, example details, and which workflows use it.
To build a workflow before your website sends the event, click Define event and type its Event name.
Start a workflow from an event
Section titled “Start a workflow from an event”Create a web workflow with the Custom event trigger, and choose the Event name. See Create a workflow.
Every event is recorded, but a workflow starts only for a visitor the web messenger already knows, such as one who has chatted before or is verified.