By integrating Google Analytics, you can track Faqprime products’ impact on your visitor behavior and conversions. You’ll see key Faqprime events in Google Analytics, including when visitors:
- Open or close a Faqprime product
- Upvote or downvote a question
- Search using auto-complete or enter key
- Viewed content, time spent, and what website they come from
- Started an automation skills app
- Took an action (pop-ups, announcement center) and more..
How to install Faqprime GA code
It's easy to integrate - you just need to paste this script (JS code) after your GA/Gtag code. In GA dashboard "Event Category: shall display the Faqprime Product Name, "Event Action: will show the Faqprime Event Name and "Event Action: will show the "URL, UC, Payload" etc.
Note: Set the UC (user context) as per the Faqprime analytics event-driven streaming API
Sample Integration Code (JS)
<script>
function FaqprimeTrackEventGA(Category, Action, Label, Value, Ob) {
"use strict";
if (typeof (gtag) !== "undefined") {
gtag('event', 'faqprime-events', {"event_category":Category, "event_label":Label, "event_action": Action, "event_uc":Value, "event_payload":Ob});
} else if (typeof (ga) !== "undefined") {
ga('send', 'event', Category, Action, Label, Value, Ob);
}
}
function faqbotEnumObjectString(xyz, pid){
for (var key in xyz) {
if (xyz.hasOwnProperty(key)) {
if (xyz[key] == pid)
return key;
}
}
}
function faqbotEventAnalyticsUpdate(event) {
var payload;
switch (typeof event.payload)
{
case 'object':
var data = "";
for(key in event.payload)
{
data = data + key + ":" + event.payload[key] + "_";
}
payload = data;
break;
default:
payload = event.payload;
break;
}
FaqprimeTrackEventGA(faqbotEnumObjectString(faqbotProductType, event.product), faqbotEnumObjectString(faqbotEvType, event.event), [event.url, event.uc, payload]);
}
</script>