Events
Track Custom Events
Frase allows you to track custom events using the following command:
frase.track({ event: "event name" });
You can also pass a "traits" object with other custom event data. For example:
frase.track({ event: "event name", traits: { "transaction_revenue" : 20, "email" : "team@frase.io" } });
Note: events will only be stored for visitors who had previously engaged Frase widgets in some way.
Event Listener
You can listen to specific events in Frase, and add custom code accordingly.
This is possible with the "on" method, which takes the event name as the argument:
frase.on("event name", function(){ // your code here });
List of Events
Currently, listener supports the following events:
- ready: when Frase is fully loaded.
- frase_sidebar: when Frase chatbot sidebar opens.
- frase_input: when visitor asks a new question.
- frase_funnel: when visitor clicks through to a new pageview.
- frase_email_capture: when Frase captures an email.
- frase_live_chat: when Frase transfers visitor to live chat.
- frase_search_click: when visitor clicks on site search result.
Event Listener Example
Do something when Frase is ready:
frase.on("ready", function(){ // your code here });