ENGLISH
Search
⌃K

Event Tracking

Heyday allows for the ability to track certain events that are not currently viewable in the Heyday Insights or advanced reports. Implementing these functions could help clients further analyze traffic gain related to heyday, which could then be tied to conversion rates.
The events that can currently be tracked are:
  • The state of the widget
  • Transfers to the agent
These events are tracked through a function called in the console section of the development tools (CTRL + Shift + I or Command + Option + I) while on the website that is loading the chat.
You can enter the appropriate function from below into the console to call back the event you’re tracking.

The state of the widget:

This function will pull back the status of the chat on a given page from the following three:
  • Welcome: The chat is closed and the welcome message bubble is displayed.
  • Closed: the chat is closed, without the welcome bubble
  • Opened: the chat is opened and visible.
From these statuses we can infer if the chat was opened or closed on a given page indicating a page that might have incited the need for the chat or from which the chat was no longer needed.
​
Function to be used:
window.hdOnWidgetStateChange = function(state) {
// state will be one of the following: "welcome", "closed", "opened"
}
Here’s an example of the most basic way to obtain the widget state:
window.hdOnWidgetStateChange = function(state) {
console.log(state)
}

Transfers to the teammate

This function will pull the time and channel in the event that the conversation was transferred to a teammate. It will only display one event per transfer meaning that if the webpage is reloaded or changed it continues to track the original event.
Function to be used:
window.hd_Conversation_Transferred = clientConversationTransferred
It should return the event in this format
{
timestamp: number,
channelId: string,
organizationId: string
}
​

Uses

These functions can be used in a number of creative ways to dictate certain chat window behaviours or for tracking purposes.
As an example, many Heyday clients use these functions in conjunction with Google analytics to better understand their client’s behaviour regarding the use of the Heyday chat on specific web pages.