Customize Guide Analytics Using APIs
You can track visitor behavior in Guide by using the CXone Dashboard and viewing Guide metrics.
Use the following APIs to define custom events, store visitor variables, store conversion data, assign and remove web tags, and more.
Set Visitor Event
Stores the defined visitor behavior (event) for reporting purposes. When this call is used with Guide, 'event_type' is changed to 'custom_event_type'. Replace 'custom_event_data' with a data parameter of any type, including an object structure.
cxone('analytics','setVisitorEvent', 'event_type', 'custom_event_data');
Set Visitor Variable
Stores the defined visitor information for reporting purposes.
cxone('analytics','setVisitorVariable', 'variable_identifier', 'variable_value');
Store Conversion
Stores the visitor behavior as a conversion for reporting purposes. If the conversion_date
parameter is omitted, the current date and time is used for the conversion.
cxone('analytics','storeConversion', 'conversion_type', conversion_value, conversion_date);
Set these as follows:
-
Replace 'conversion_type' with a value such as USD.
-
Replace conversion _value with a numeric value to use in Guide reports to track the effectiveness of engagements.
-
Replace conversion_date with a JavaScript date object. If omitted, new Date() is used.
Assign Web Visitor Tag
Adds specified tags to a visitor. In the following syntax example, replace 'tagID' with a visitor tag.
cxone('analytics','addVisitorTags', 'tagID');
Remove Web Visitor Tag
Removes specific tags from a visitor. In the following syntax example, replace 'tagID' with a visitor tag.
cxone('analytics','removeVisitorTags', 'tagID');
Clear Visit Data
Removes information about the current visit. The visit is the browsing session. If user reloads a page, Guide considers it a new visit.
cxone('analytics','clearVisit');
Set Country
Allows setting custom country value. Input is a string. Replace 'Country' with a browser country code.
cxone('analytics','setDeviceCountry','Country');
Set Location
Allows setting custom location value. Input is a string. Replace 'Location' with a browser location code.
cxone('analytics','setDeviceLocation','Location');
Turn Off SPA Detection
Turns off automated single page application detection.
cxone('analytics', 'setSPADetection', false);
Page Loaded
Allows Guide to recognize that a page has been refreshed. This is used when single page application detection is off. Input is a string. Replace 'page-url' with the page URL or replace 'page-title' with the page title.
cxone('analytics', 'sendPageView', {url: 'page-url'});
cxone('analytics', 'sendPageView', {title: 'page-title'});
Disable Web Tracking
Disables the web tracking module.
cxone('disableModule', 'analytics');