Before using these events, ensure that the Frontnow Advisor has been properly initialized. For setup instructions, please refer to the page.
Google Analytics Integration
If your site already integrates with Google Analytics, all of the advisor events will be automatically forwarded with the prefix "frontnow:[eventname]"
Examples: frontnow:open orfrontnow:message
ready
This event gets triggered when the Frontnow Advisor is initialized.
advisor.on('ready', () => {
console.log('Advisor is ready!');
});
open
This event gets triggered when the Frontnow Advisor is opened.
advisor.on('open', () => {
console.log('Advisor is open!');
});
close
This event gets triggered when the Frontnow Advisor is closed.
advisor.on('close', () => {
console.log('Advisor is closed!');
});
message
This event gets triggered when a message is received.
/**
* @typedef {Object} DiscoveryTopicEventData
* @property {string} topic - The identifier of the discovery topic.
* @property {string} title - The title of the discovery topic.
* @property {string} value - The prompt text for the discovery topic.
*/
document-click
This event gets triggered when a document is clicked.
/**
* @typedef {Object} DocumentClickEventData
* @property {string} title - The title of the clicked document.
* @property {string} url - The URL of the clicked document.
*/
follow-up-click
This event gets triggered when a follow-up question is clicked.
/**
* @typedef {Object} FollowUpClickEventData
* @property {string} question - The follow-up question.
* @property {string} headline - The headline associated with the follow-up question.
* @property {string} prompt - The prompt text for the follow-up question.
*/