Faqprime Helpbot allows you to track when a user clicks on a specific question. This can be either through a search or directly. When this happens, Faqprime triggers the “FAQBOT_QUESTION_CLICK” event, along with the question id.
To access this event, you need to define the JavaScript function faqbotEventNotification.
Here’s an example of how you can do this:
function faqbotEventNotification(e)
{
console.log(e.event);
console.log(e.url);
if (e.event == 10) // 10 i.e. faqbotEventType.FAQBOT_QUESTION_CLICK is the event id for the question click
{
console.log(e.data);
}
}
Let’s say you want to track how many times the “Add To Cart” action is performed after a user has read a question. You can achieve this by following these steps with Google Analytics:
Define the function as shown above. If the event is 10, set a global state “faqprime_question_clicked” as “true”. You can initialize this as “false”.
Whenever the user clicks the “Add to Cart” button, check the “faqprime_question_clicked” state. If it is “true”, set a goal ATC_after_question_read.
And that’s it! You’ve now set up tracking for both question clicks and subsequent “Add To Cart” actions.