Google Articles

Google Analytics Integration overview

Bold360 AI allows you to track your visitor's behavior and activity using the Google Analytics platform.

Note: If you are using Google Analytics 4, you'll need to implement custom code on your website to send data. For more information contact your Customer Success Manager.

There are two ways to implement Google Analytics snippet: synchronous and asynchronous. Currently, we only support the asynchronous snippets.

Google Analytics integration is enabled by your Customer Success Manager and you will be able to see the results in your GA Dashboard within 24 hours of activation.

Our goal is to allow maximum transparency and usability of the Bold360 AI framework to drive a better customer experience and, ultimately, value: BI, conversion increase and cost-reduction.

Custom events

If you want to send additional/customizable events, you can use our events API to trigger custom functions, including Google Analytics sending sequences. See our Events API documentation below:

Bold360 ai Events API (Arcade and Modern)

Bold360 ai Events API (Slim)

If you use our Support Center, it is also possible to add custom events for visitor's interaction there. For example, you can track click events on navigation, escalations, articles feedback and so on.

How to integrate Google Analytics with BoldChat

Integrate Google Analytics with Layered Chat Windows, track visitor interactions as Analytics events and gain accurate insight into visitor behavior.

As dynamic elements on a website, Layered Chat Windows require a mechanism to cache tracking information and provide accurate results. This step-by-step guide describes a Local Storage implementation that allows data to persist when a chat session is interrupted.

Note: Interruptions usually happen in the following circumstances:
  • Visitor navigates to a new page under the same domain.
  • Connection dropout occurs.
  • Visitor browses multiple pages on the website simultaneously.
  • Visitor closes and re-opens or reloads a page.

The Local Storage technology is compatible with the following browsers:

See the WebStorage article on Wikipedia for details.

Note: For information about Google Analytics and data residency, see Data Residency Options.

Prerequisites

All pages on your site must either include or reference the following code snippets:

Tip: Streamline code snippet delivery via Google Tag Manager.

Code locations in BoldChat for Task One, Task Two and Task Three.

Task One: Configure the Chat Frame Javascript Include

Add a Chat Frame Javascript Include to the Chat Window Definition deployed to your site. This code intercepts chat events and passes them to the chat window via the postMessage method.

Note: This is the method how Layered Chat internal events are already communicated between the Chat Frame (hosted on livechat[-eu].boldchat.com) and the Chat Window (the container, hosted on the same website that the visitor is browsing). Using this method we are basically extending the existing Chat communications methods by adding a new key ( gacomm) for these custom messages.
try {
  function sendtxt(txt) {
    var message = JSON.stringify({
      gacomm: txt
    });
    parent.parent.postMessage(message, "*");
  }
  sendtxt(bcConfig.chatOptions.page);
  window.console && console.log("Sent Chat Window Page: " + bcConfig.chatOptions.page);
  if (bcConfig.chatOptions.page == "chat") {
    var _tEvents = {
        "new-message": "bc_newHistoryMessageCallback"
      },
      _tFunction = function(i, type, fName) {
        if ((i == "new-message") && (bc.$("#bc-status-prompt").prev().hasClass("bc-operator-message"))) {
          sendtxt("answered");
        }
      }
  }
  for (var i in _tEvents) {
    window[_tEvents[i]] = _tFunction.bind(window, i, "function", _tEvents[i]);
  }
} catch (err) {
  window.console && console.error(err);
}
Tip: Looking for a quick solution? Download the full code attached to this article (chatframejs.txt).

Task Two: Configure the Chat Window Javascript Include

Add a Chat Window Javascript Include to the Chat Window Definition deployed to your site.

Note: It is recommended to encapsulate the code snippets in this section in a try/catch phrase to detect potential issues later on.
  1. Open a try/catch and import inline the LS CACHE minified script.
    Note: The Chat Window Javascript Include code depends on the LS CACHE library to manage the expiration time of Local Storage entities. We strongly recommend that you include the following minified code on your website, instead of referencing the library:
    try {
    
    /**
    * lscache library
    * Copyright (c) 2011, Pamela Fox
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    **/
    
    !function(a,b){"function"==typeof define&&define.amd?define([],b):"undefined"!=typeof module&&module.exports?module.exports=b():a.lscache=b()}(this,function(){function a(){var a="__lscachetest__",c=a;if(void 0!==m)return m;try{g(a,c),h(a),m=!0}catch(d){m=b(d)?!0:!1}return m}function b(a){return a&&"QUOTA_EXCEEDED_ERR"===a.name||"NS_ERROR_DOM_QUOTA_REACHED"===a.name||"QuotaExceededError"===a.name?!0:!1}function c(){return void 0===n&&(n=null!=window.JSON),n}function d(a){return a+p}function e(){return Math.floor((new Date).getTime()/r)}function f(a){return localStorage.getItem(o+t+a)}function g(a,b){localStorage.removeItem(o+t+a),localStorage.setItem(o+t+a,b)}function h(a){localStorage.removeItem(o+t+a)}function i(a){for(var b=new RegExp("^"+o+t+"(.*)"),c=localStorage.length-1;c>=0;--c){var e=localStorage.key(c);e=e&&e.match(b),e=e&&e[1],e&&e.indexOf(p)<0&&a(e,d(e))}}function j(a){var b=d(a);h(a),h(b)}function k(a){var b=d(a),c=f(b);if(c){var g=parseInt(c,q);if(e()>=g)return h(a),h(b),!0}}function l(a,b){u&&"console"in window&&"function"==typeof window.console.warn&&(window.console.warn("lscache - "+a),b&&window.console.warn("lscache - The error was: "+b.message))}var m,n,o="lscache-",p="-cacheexpiration",q=10,r=6e4,s=Math.floor(864e13/r),t="",u=!1,v={set:function(k,m,n){if(a()){if("string"!=typeof m){if(!c())return;try{m=JSON.stringify(m)}catch(o){return}}try{g(k,m)}catch(o){if(!b(o))return void l("Could not add item with key '"+k+"'",o);var p,r=[];i(function(a,b){var c=f(b);c=c?parseInt(c,q):s,r.push({key:a,size:(f(a)||"").length,expiration:c})}),r.sort(function(a,b){return b.expiration-a.expiration});for(var t=(m||"").length;r.length&&t>0;)p=r.pop(),l("Cache is full, removing item with key '"+k+"'"),j(p.key),t-=p.size;try{g(k,m)}catch(o){return void l("Could not add item with key '"+k+"', perhaps it's too big?",o)}}n?g(d(k),(e()+n).toString(q)):h(d(k))}},get:function(b){if(!a())return null;if(k(b))return null;var d=f(b);if(!d||!c())return d;try{return JSON.parse(d)}catch(e){return d}},remove:function(b){a()&&j(b)},supported:function(){return a()},flush:function(){a()&&i(function(a){j(a)})},flushExpired:function(){a()&&i(function(a){k(a)})},setBucket:function(a){t=a},resetBucket:function(){t=""},enableWarnings:function(a){u=a}};return v});
    Tip: Looking for a quick solution? Download the full code attached to this article (chatwindowjs.txt).
  2. Define the events to be reported in Google Analytics.
    var ga_events = {
      	"prechat": 'PreChat Form Displayed',
      	"chat": "Chat Opened",
      	"answered": "Chat Answered",
      	"postchat": "Survey Displayed",
      	"email": "Email Form (Unavailable)",
      	"no-operators": "Unavailable Chat",
      	"chat-sent": "Survey Completed or Transcript",
      	"message-sent": "Unavailable Email Sent",
      	"final": "Chat Ended without Survey or Transcript"
    	}
  3. Validate messages for security reasons.

    The following code achieves the following:

    • Ensures messages come from the livechat[-eu].boldchat.com server
    • Parses messages
    • Checks localStorage for existing events to be de-duplicated and discarded, if necessary
    • Sends relevant events to Google Analytics

    Note how individual events are stored in the browser localStorage with a CID, a unique identifier for Chat windows that survives page re-loads, browser closing/reopening as well as navigation on different tabs under the same domain.

    The code also ensures that the user is able to start multiple simultaneous chats on different domains while events are accounted for separately and accurately.

    function listener(event) {
      if (event.origin !== "https://" + bcConfig.host) return;
      var pmessage = JSON.parse(event.data);
      if (pmessage.hasOwnProperty('gacomm')) {
        window.console && console.log("Received: " + event.data);
        var received = pmessage.gacomm + "---" + bcConfig.cid;
        var found = false;
        lscache.flushExpired();
        CIDs = lscache.get('CIDs');
        if (CIDs !== null) {
          var arrayLength = CIDs.length;
          for (var i = 0; i < arrayLength; i++) {
            if (CIDs[i] == received) {
              found = true;
              break;
            };
          };
        } else {
          CIDs = [];
        }
        if (!found) {
          CIDs.push(received);
          lscache.set('CIDs', CIDs, 60);
          window.console && console.log("Sending new event to GA: " + received);
          try {
            ga('send', 'event', {
              eventCategory: 'Live Chat',
              eventAction: ga_events[pmessage.gacomm],
              eventLabel: 'Chat Window'
            });
          } catch (err) {
            window.console && console.error("Google Analytics UA code not found on page");
          }
        }
      }
    }
    if (window.addEventListener) {
      addEventListener("message", listener, false)
    } else {
      attachEvent("onmessage", listener)
    }
  4. Close the try/catch:
    } catch (err) {
      window.console && console.error(err);
    }

Task Three: Video Chat Events (Optional)

Track video chat events by updating your Chat Frame and Chat Window Javascript Includes.

Note: The video chat feature works over the HTTPS exclusively. If your site does not support secure connections, BoldChat opens the chat in a popup window and switches to HTTPS. In this case, you must include the Google Analytics snippet at the top of the Chat Window Javascript Include code to be able to send tracking data to Google Analytics.

Tracking messages contain specific video chat events that are assigned to individual Event Categories. This data is appended to _tEvents objects.

  1. Use the following Chat Frame Javascript Include code on your site:
    /* Chat Frame Javascript Include */
    
    try {
      var VIDEOCHAT_CATEGORY = 'Video Chat';
    
      var trackEventByVideoSessionStatus = {
        3: { event: "videochat-started", initiatedBy: "By Visitor"},
        4: { event: "videochat-started", initiatedBy: "By Operator"},
        7: { event: "videochat-ended", initiatedBy: "By Operator"},
        8: { event: "videochat-ended",  initiatedBy: "By Visitor"}
      };
    
      function sendtxt(txt, category, parameter) {
        var message = JSON.stringify({
          gacomm: txt,
          eventCategory: category || 'Live Chat',
          eventParameter: parameter || 'Chat Window'
        });
    
        parent.parent.postMessage(message, "*");
      }
    
      sendtxt(bcConfig.chatOptions.page);
      window.console && console.log("Sent Chat Window Page: " + bcConfig.chatOptions.page);
      if (bcConfig.chatOptions.page == "chat") {
        var _tEvents = {
            "new-message": "bc_newHistoryMessageCallback",
            "video-support": "bc_chatWindowLoadedEventCallback",
            "video-statechange": "bc_videochatStatusChangedCallback"
          },
          _tFunction = function(i, type, fName, value) {
            if ((i == "new-message") && (bc.$("#bc-status-prompt").prev().hasClass("bc-operator-message"))) {
              sendtxt("answered");
            }
    
            if ((i == "video-support")) {
                if (bcConfig.videoSupport) {
                    sendtxt("videochat-available", VIDEOCHAT_CATEGORY);
                }
                else {
                    sendtxt("videochat-unavailable", VIDEOCHAT_CATEGORY);
                }
            }
    
            if ((i == "video-statechange")) {
                var trackEvent = trackEventByVideoSessionStatus[value];
                if (trackEvent) {
                  sendtxt(trackEvent.event, VIDEOCHAT_CATEGORY, trackEvent.initiatedBy);
                }
    
                if (bcConfig.videoSupport.isAudioOnly && trackEvent && trackEvent.event === "videochat-started") {
                  sendtxt("videochat-audio-only", VIDEOCHAT_CATEGORY);
                }
              }
          }
      }
      for (var i in _tEvents) {
        window[_tEvents[i]] = _tFunction.bind(window, i, "function", _tEvents[i]);
      }
    } catch (err) {
      window.console && console.error(err);
    }
    Tip: Looking for a quick solution? Download the full code by clicking the attachment of this article.
  2. In Google Analytics, ga_events objects must contain the new event definitions in the Chat Window Javascript Include.
    var ga_events = {
      "prechat": 'PreChat Form Displayed',
      "chat": "Chat Opened",
      "answered": "Chat Answered",
      "postchat": "Survey Displayed",
      "email": "Email Form (Unavailable)",
      "no-operators": "Unavailable Chat",
      "chat-sent": "Survey Completed or Transcript",
      "message-sent": "Unavailable Email Sent",
      "final": "Chat Ended without Survey or Transcript",
      "videochat-available": "Video Chat Available",
      "videochat-unavailable": "Video Chat Unavailable",
      "videochat-started": "Video Chat Started",
      "videochat-ended": "Video Chat Ended",
      "videochat-audio-only": "Chat is Audio Only"
    }
    Update the ga message to send new tracking parameters.
    function listener(event) {
      if (event.origin !== "https://livechat.boldchat.com") return;
      var pmessage = JSON.parse(event.data);
      if (pmessage.hasOwnProperty('gacomm') 
          && pmessage.hasOwnProperty('eventCategory') 
          && pmessage.hasOwnProperty('eventParameter')) {
        window.console && console.log("Received: " + event.data);
        var received = pmessage.gacomm + "-" + bcConfig.cid;
        var found = false;
        lscache.flushExpired();
        CIDs = lscache.get('CIDs');
        if (CIDs !== null) {
          var arrayLength = CIDs.length;
          for (var i = 0; i < arrayLength; i++) {
            if (CIDs[i] == received) {
              found = true;
              break;
            };
          };
        } else {
          CIDs = [];
        }
        if (!found) {
          CIDs.push(received);
          lscache.set('CIDs', CIDs, 60);
          window.console && console.log("Sending new event to GA: " + received);
          try {
            ga('send', 'event', {
              eventCategory: pmessage.eventCategory,
              eventAction: ga_events[pmessage.gacomm],
              eventLabel: pmessage.eventParameter
            });
          } catch (err) {
            window.console && console.error("Google Analytics UA code not found on page");
          }
        }
      }
    }
    if (window.addEventListener) {
      addEventListener("message", listener, false)
    } else {
      attachEvent("onmessage", listener)
    }
    } catch (err) {
      window.console && console.error(err);
    }
    Tip: Looking for a quick solution? Download the full code by clicking the attachment of this article.

Reporting

Events are reported with a few seconds' delay under the Real-Time Events section and they are processed and made available within 24 hours under the Behavior section as well as Dimensions in Custom Reports, allowing maximum flexibility to be tied to any other Google Analytics dimension and metric.


Troubleshooting

For troubleshooting purposes and to ensure that events are transmitted correctly, the code above outputs three log lines for each chat event in the browser console, if available.


Similarly, in case the Google Analytics code is not found by BoldChat on the hosting website page, the following error is thrown in the browser console, if available:


Google Analytics Integration with Bold360 Layered Windows

Integrate Google Analytics with Layered Chat Windows, track visitor interactions as Analytics events and gain accurate insight into visitor behavior.

As dynamic elements on a website, Layered Chat Windows require a mechanism to cache tracking information and provide accurate results. This step-by-step guide describes a Local Storage implementation that allows data to persist when a chat session is interrupted.

Note: Interruptions usually happen in the following circumstances:
  • Visitor navigates to a new page under the same domain.
  • Connection dropout occurs.
  • Visitor browses multiple pages on the website simultaneously.
  • Visitor closes and re-opens or reloads a page.

The Local Storage technology is compatible with the following browsers:

  • Google Chrome recommended (Last 20 versions)
  • Mozilla Firefox on Windows (Last 10 versions)
  • Microsoft Edge
  • Microsoft Internet Explorer 9 and newer
  • Safari on macOS (Last two versions)
  • Opera (Last 10 versions)

See the WebStorage article on Wikipedia for details.

Note: For information about data residency, see the BoldChat Help Center. Bold360 and BoldChat data residency options are identical.

Prerequisites

All pages on your site must either include or reference the following code snippets:

Tip: Streamline code snippet delivery via Google Tag Manager.

Task One: Configure the Chat Frame Javascript Include

Add a Chat Frame Javascript Include to the Chat Window Definition deployed to your site. This code intercepts chat events and passes them to the chat window via the postMessage method.

  1. Go to Channels > Chat > Chat Windows > Customization tab.
  2. Under Appearance, select Layered - Details > Includes > Chat Frame Javascript Include.
  3. Add the following method to the Content field at the bottom:
    Note: This is the method how Layered Chat internal events are already communicated between the Chat Frame (hosted on livechat[-eu].boldchat.com) and the Chat Window (the container, hosted on the same website that the visitor is browsing). Using this method we are basically extending the existing Chat communications methods by adding a new key (gacomm) for these custom messages.
    try {
      function sendtxt(txt) {
        var message = JSON.stringify({
          gacomm: txt
        });
        parent.parent.postMessage(message, "*");
      }
      sendtxt(bcConfig.chatOptions.page);
      window.console && console.log("Sent Chat Window Page: " + bcConfig.chatOptions.page);
      if (bcConfig.chatOptions.page == "chat") {
        var _tEvents = {
            "new-message": "bc_newHistoryMessageCallback"
          },
          _tFunction = function(i, type, fName) {
            if ((i == "new-message") && (bc.$("#bc-status-prompt").prev().hasClass("bc-operator-message"))) {
              sendtxt("answered");
            }
          }
      }
      for (var i in _tEvents) {
        window[_tEvents[i]] = _tFunction.bind(window, i, "function", _tEvents[i]);
      }
    } catch (err) {
      window.console && console.error(err);
    }
  4. Save your changes.

Task Two: Configure the Chat Window Javascript Include

Add a Chat Window Javascript Include to the Chat Window Definition deployed to your site.

Note: It is recommended to encapsulate the code snippets in this section in a try/catch phrase to detect potential issues later on.
  1. Go to Channels > Chat > Chat Windows > Customization tab.
  2. Under Appearance, select Layered - Details > Includes > Chat Window Javascript Include.
  3. Open a try/catch and import inline the LS CACHE minified script.
    Note: The Chat Window Javascript Include code depends on the LS CACHE library to manage the expiration time of Local Storage entities. We strongly recommend that you include the following minified code on your website, instead of referencing the library:
    try {
    
    /**
    * lscache library
    * Copyright (c) 2011, Pamela Fox
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    **/
    
    !function(a,b){"function"==typeof define&&define.amd?define([],b):"undefined"!=typeof module&&module.exports?module.exports=b():a.lscache=b()}(this,function(){function a(){var a="__lscachetest__",c=a;if(void 0!==m)return m;try{g(a,c),h(a),m=!0}catch(d){m=b(d)?!0:!1}return m}function b(a){return a&&"QUOTA_EXCEEDED_ERR"===a.name||"NS_ERROR_DOM_QUOTA_REACHED"===a.name||"QuotaExceededError"===a.name?!0:!1}function c(){return void 0===n&&(n=null!=window.JSON),n}function d(a){return a+p}function e(){return Math.floor((new Date).getTime()/r)}function f(a){return localStorage.getItem(o+t+a)}function g(a,b){localStorage.removeItem(o+t+a),localStorage.setItem(o+t+a,b)}function h(a){localStorage.removeItem(o+t+a)}function i(a){for(var b=new RegExp("^"+o+t+"(.*)"),c=localStorage.length-1;c>=0;--c){var e=localStorage.key(c);e=e&&e.match(b),e=e&&e[1],e&&e.indexOf(p)<0&&a(e,d(e))}}function j(a){var b=d(a);h(a),h(b)}function k(a){var b=d(a),c=f(b);if(c){var g=parseInt(c,q);if(e()>=g)return h(a),h(b),!0}}function l(a,b){u&&"console"in window&&"function"==typeof window.console.warn&&(window.console.warn("lscache - "+a),b&&window.console.warn("lscache - The error was: "+b.message))}var m,n,o="lscache-",p="-cacheexpiration",q=10,r=6e4,s=Math.floor(864e13/r),t="",u=!1,v={set:function(k,m,n){if(a()){if("string"!=typeof m){if(!c())return;try{m=JSON.stringify(m)}catch(o){return}}try{g(k,m)}catch(o){if(!b(o))return void l("Could not add item with key '"+k+"'",o);var p,r=[];i(function(a,b){var c=f(b);c=c?parseInt(c,q):s,r.push({key:a,size:(f(a)||"").length,expiration:c})}),r.sort(function(a,b){return b.expiration-a.expiration});for(var t=(m||"").length;r.length&&t>0;)p=r.pop(),l("Cache is full, removing item with key '"+k+"'"),j(p.key),t-=p.size;try{g(k,m)}catch(o){return void l("Could not add item with key '"+k+"', perhaps it's too big?",o)}}n?g(d(k),(e()+n).toString(q)):h(d(k))}},get:function(b){if(!a())return null;if(k(b))return null;var d=f(b);if(!d||!c())return d;try{return JSON.parse(d)}catch(e){return d}},remove:function(b){a()&&j(b)},supported:function(){return a()},flush:function(){a()&&i(function(a){j(a)})},flushExpired:function(){a()&&i(function(a){k(a)})},setBucket:function(a){t=a},resetBucket:function(){t=""},enableWarnings:function(a){u=a}};return v});
  4. Define the events to be reported in Google Analytics.
    var ga_events = {
      	"prechat": 'PreChat Form Displayed',
      	"chat": "Chat Opened",
      	"answered": "Chat Answered",
      	"postchat": "Survey Displayed",
      	"email": "Email Form (Unavailable)",
      	"no-operators": "Unavailable Chat",
      	"chat-sent": "Survey Completed or Transcript",
      	"message-sent": "Unavailable Email Sent",
      	"final": "Chat Ended without Survey or Transcript"
    	}
  5. Validate messages for security reasons.

    The following code achieves the following:

    • Ensures messages come from the livechat[-eu].boldchat.com server
    • Parses messages
    • Checks localStorage for existing events to be de-duplicated and discarded, if necessary
    • Sends relevant events to Google Analytics

    Note how individual events are stored in the browser localStorage with a CID, a unique identifier for Chat windows that survives page re-loads, browser closing/reopening as well as navigation on different tabs under the same domain.

    The code also ensures that the user is able to start multiple simultaneous chats on different domains while events are accounted for separately and accurately.

    function listener(event) {
      if (event.origin !== "https://" + bcConfig.host) return;
      var pmessage = JSON.parse(event.data);
      if (pmessage.hasOwnProperty('gacomm')) {
        window.console && console.log("Received: " + event.data);
        var received = pmessage.gacomm + "---" + bcConfig.cid;
        var found = false;
        lscache.flushExpired();
        CIDs = lscache.get('CIDs');
        if (CIDs !== null) {
          var arrayLength = CIDs.length;
          for (var i = 0; i < arrayLength; i++) {
            if (CIDs[i] == received) {
              found = true;
              break;
            };
          };
        } else {
          CIDs = [];
        }
        if (!found) {
          CIDs.push(received);
          lscache.set('CIDs', CIDs, 60);
          window.console && console.log("Sending new event to GA: " + received);
          try {
            ga('send', 'event', {
              eventCategory: 'Live Chat',
              eventAction: ga_events[pmessage.gacomm],
              eventLabel: 'Chat Window'
            });
          } catch (err) {
            window.console && console.error("Google Analytics UA code not found on page");
          }
        }
      }
    }
    if (window.addEventListener) {
      addEventListener("message", listener, false)
    } else {
      attachEvent("onmessage", listener)
    }
  6. Close the try/catch:
    } catch (err) {
      window.console && console.error(err);
    }

Task Three: Video Chat Events (Optional)

Track video chat events by updating your Chat Frame and Chat Window Javascript Includes.

Note: The video chat feature works over the HTTPS exclusively. If your site does not support secure connections, Bold360 opens the chat in a popup window and switches to HTTPS. In this case, you must include the Google Analytics snippet at the top of the Chat Window Javascript Include code to be able to send tracking data to Google Analytics.

Tracking messages contain specific video chat events that are assigned to individual Event Categories. This data is appended to _tEvents objects.

  1. Use the following Chat Frame Javascript Include code on your site:
    /* Chat Frame Javascript Include */
    
    try {
      var VIDEOCHAT_CATEGORY = 'Video Chat';
    
      var trackEventByVideoSessionStatus = {
        3: { event: "videochat-started", initiatedBy: "By Visitor"},
        4: { event: "videochat-started", initiatedBy: "By Operator"},
        7: { event: "videochat-ended", initiatedBy: "By Operator"},
        8: { event: "videochat-ended",  initiatedBy: "By Visitor"}
      };
    
      function sendtxt(txt, category, parameter) {
        var message = JSON.stringify({
          gacomm: txt,
          eventCategory: category || 'Live Chat',
          eventParameter: parameter || 'Chat Window'
        });
    
        parent.parent.postMessage(message, "*");
      }
    
      sendtxt(bcConfig.chatOptions.page);
      window.console && console.log("Sent Chat Window Page: " + bcConfig.chatOptions.page);
      if (bcConfig.chatOptions.page == "chat") {
        var _tEvents = {
            "new-message": "bc_newHistoryMessageCallback",
            "video-support": "bc_chatWindowLoadedEventCallback",
            "video-statechange": "bc_videochatStatusChangedCallback"
          },
          _tFunction = function(i, type, fName, value) {
            if ((i == "new-message") && (bc.$("#bc-status-prompt").prev().hasClass("bc-operator-message"))) {
              sendtxt("answered");
            }
    
            if ((i == "video-support")) {
                if (bcConfig.videoSupport) {
                    sendtxt("videochat-available", VIDEOCHAT_CATEGORY);
                }
                else {
                    sendtxt("videochat-unavailable", VIDEOCHAT_CATEGORY);
                }
            }
    
            if ((i == "video-statechange")) {
                var trackEvent = trackEventByVideoSessionStatus[value];
                if (trackEvent) {
                  sendtxt(trackEvent.event, VIDEOCHAT_CATEGORY, trackEvent.initiatedBy);
                }
    
                if (bcConfig.videoSupport.isAudioOnly && trackEvent && trackEvent.event === "videochat-started") {
                  sendtxt("videochat-audio-only", VIDEOCHAT_CATEGORY);
                }
              }
          }
      }
      for (var i in _tEvents) {
        window[_tEvents[i]] = _tFunction.bind(window, i, "function", _tEvents[i]);
      }
    } catch (err) {
      window.console && console.error(err);
    }
    Tip: Looking for a quick solution? Download the full code by clicking the attachment of this article.
  2. In Google Analytics, ga_events objects must contain the new event definitions in the Chat Window Javascript Include.
    var ga_events = {
      "prechat": 'PreChat Form Displayed',
      "chat": "Chat Opened",
      "answered": "Chat Answered",
      "postchat": "Survey Displayed",
      "email": "Email Form (Unavailable)",
      "no-operators": "Unavailable Chat",
      "chat-sent": "Survey Completed or Transcript",
      "message-sent": "Unavailable Email Sent",
      "final": "Chat Ended without Survey or Transcript",
      "videochat-available": "Video Chat Available",
      "videochat-unavailable": "Video Chat Unavailable",
      "videochat-started": "Video Chat Started",
      "videochat-ended": "Video Chat Ended",
      "videochat-audio-only": "Chat is Audio Only"
    }
    Update the ga message to send new tracking parameters.
    function listener(event) {
      if (event.origin !== "https://livechat.boldchat.com") return;
      var pmessage = JSON.parse(event.data);
      if (pmessage.hasOwnProperty('gacomm') 
          && pmessage.hasOwnProperty('eventCategory') 
          && pmessage.hasOwnProperty('eventParameter')) {
        window.console && console.log("Received: " + event.data);
        var received = pmessage.gacomm + "-" + bcConfig.cid;
        var found = false;
        lscache.flushExpired();
        CIDs = lscache.get('CIDs');
        if (CIDs !== null) {
          var arrayLength = CIDs.length;
          for (var i = 0; i < arrayLength; i++) {
            if (CIDs[i] == received) {
              found = true;
              break;
            };
          };
        } else {
          CIDs = [];
        }
        if (!found) {
          CIDs.push(received);
          lscache.set('CIDs', CIDs, 60);
          window.console && console.log("Sending new event to GA: " + received);
          try {
            ga('send', 'event', {
              eventCategory: pmessage.eventCategory,
              eventAction: ga_events[pmessage.gacomm],
              eventLabel: pmessage.eventParameter
            });
          } catch (err) {
            window.console && console.error("Google Analytics UA code not found on page");
          }
        }
      }
    }
    if (window.addEventListener) {
      addEventListener("message", listener, false)
    } else {
      attachEvent("onmessage", listener)
    }
    } catch (err) {
      window.console && console.error(err);
    }
    Tip: Looking for a quick solution? Download the full code by clicking the attachment of this article.

Reporting

Events are reported with a few seconds' delay under the Real-Time Events section and they are processed and made available within 24 hours under the Behavior section as well as Dimensions in Custom Reports, allowing maximum flexibility to be tied to any other Google Analytics dimension and metric.


Troubleshooting

For troubleshooting purposes and to ensure that events are transmitted correctly, the code above outputs three log lines for each chat event in the browser console, if available.


Similarly, in case the Google Analytics code is not found by Bold360 on the hosting website page, the following error is thrown in the browser console, if available:


Can I see an example of Bold360 AI conversion tracking in Google Analytics?

Note: Conversion tracking has been integrated into Bold360 Acquire. For more information, contact your Customer Success Manager.

This is an example of an eCommerce website that asked us to install a Google Analytics tracking on their widget.

This screen is the 'Ecommerce Overview' (Standard Reporting > Conversions > Ecommerce) that is in common use for eCommerce websites. As you can see, the conversion rate with the Bold360 AI event show higher percentage.

Announcements

Join the DX Community!

Meet fellow DX pros, ask questions, and learn best practices.

Join the DX Community

Featured

Allowlists and the Bold360 platform

Allowlists and the Digital DX AI platform

To use Genesys DX, you may want to allowlist certain URLs so that its connected services are able to connect.

We recommend you add the following URLs to your network's allowlist:

  • *.boldchat.com, *bold360.com, *.bold360usercontent.com  - Genesys' service for adding chat to websites
  • *.nanorep.co ? The site for customers who have access to the Bold360 AI platform (Service, Advise, and Acquire)
  • authentication.logmeininc.com, auth.bold360.com - LogMeIn's sign-in service
  • launch.bold360.com, myaccount.logmeininc.com, profile.logmeininc.com - LogMeIn's MyAccount page, where you can manage and access all your LogMeIn products

*** Please note that *.logmeininc.com domains and IP Addresses/ranges are only needed temporarily while the BoldChat/Bold360 platforms complete their migration to Genesys architecture.

Note: This list includes sub-domains for the listed domains, so it is advisable to use wildcard rules wherever possible when you allow or block any LogMeIn service on your network. Specifically, we recommend you to allow *bold360.com and *logmeininc.com. The services themselves communicate using port 443 (HTTPS/SSL) and port 80, so you don't need to open any additional ports within a firewall.

LogMeIn IP ranges

We recommend you add LogMeIn domains and URLs to your network's allowlist instead of allowing LogMeIn IP ranges. If that is not feasible, refer to the list of LogMeIn IP addresses.

CIDR Notation Numeric IP Range Netmask Notation
67.217.80.0/23 67.217.80.0 - 67.217.81.255 67.217.80.0 255.255.254.0
95.172.70.0/24 95.172.70.0 - 95.172.70.255 95.172.70.0 255.255.255.0
173.199.52.0/23 173.199.52.1 - 173.199.53.254 173.199.52.0 255.255.254.0

IP addresses for the sign in service

To sign in to your Bold360 work environment, you must allow LogMeIn's sign-in service. To do that by IP addresses, add the following IPs to your firewall settings:

  • 34.199.209.240
  • 35.173.84.18
  • 78.108.120.24
  • 173.199.2.47
  • 173.199.4.47

Email addresses for the sign in service

Make sure you allow the following email addresses so that identity-related and authentication emails are received:

  • noreply@logmein.com
  • support@bold360.com

Third-party IP Ranges

You must also allowlist ranges for these third-party services based upon your use of these service providers:

Email Domains

For email invitations and correspondences from us and the BoldChat/Bold360 software, we recommend allowing the following email domains through your email's spam and allowlist filters.

  • noreply@logmein.com
  • support@bold360.com

*** Please note that *.logmeininc.com domains and IP Addresses/ranges are only needed temporarily while the BoldChat/Bold360 platforms complete their migration to Genesys architecture.

 

Update as of January 18, 2022

Beginning on October 9, 2021, additional changes are taking place as part of the migration process of the DX platform from LMI to Genesys. The failover will take place in 3 stages from LMI on-premise data centers to Genesys cloud-based environment which provides robustness, flexibility and better scalability to the DX platform.

[ACTION] - If you allow list Agent (formerly known as BoldChat) by domain (preferred to DNS or IP allowlisting), you will need to allowlist the following domains in your organization's network/firewall:

  • bold360.com
  • boldchat.com

Alternatively, you can allowlist the following DNS servers:

Ireland

  • eub-app16-01.boldchat.com
  • eub-app16-02.boldchat.com
  • eub-app16-03.boldchat.com
  • eub-app16-04.boldchat.com
  • eub-app16-05.boldchat.com
  • eub-app16-06.boldchat.com
  • eub-app16-07.boldchat.com
  • eub-app16-08.boldchat.com
  • eub-app16-09.boldchat.com
  • eub-app16-10.boldchat.com
  • eub-app16-11.boldchat.com
  • eub-app16-12.boldchat.com

Frankfurt

  • eub-app17-01.boldchat.com
  • eub-app17-02.boldchat.com
  • eub-app17-03.boldchat.com
  • eub-app17-04.boldchat.com
  • eub-app17-05.boldchat.com
  • eub-app17-06.boldchat.com
  • eub-app17-07.boldchat.com
  • eub-app17-08.boldchat.com
  • eub-app17-09.boldchat.com
  • eub-app17-10.boldchat.com
  • eub-app17-11.boldchat.com
  • eub-app17-12.boldchat.com

US East (N. Virginia)

  • b-app18-01.boldchat.com
  • b-app18-02.boldchat.com
  • b-app18-03.boldchat.com
  • b-app18-04.boldchat.com
  • b-app18-05.boldchat.com
  • b-app18-06.boldchat.com
  • b-app18-07.boldchat.com
  • b-app18-08.boldchat.com
  • b-app18-09.boldchat.com
  • b-app18-10.boldchat.com
  • b-app18-11.boldchat.com
  • b-app18-12.boldchat.com
  • b-app18-13.boldchat.com
  • b-app18-14.boldchat.com
  • b-app18-15.boldchat.com
  • b-app18-16.boldchat.com
  • b-app18-17.boldchat.com
  • b-app18-18.boldchat.com
  • b-app18-19.boldchat.com
  • b-app18-20.boldchat.com
  • b-app18-21.boldchat.com
  • b-app18-22.boldchat.com
  • b-app18-23.boldchat.com
  • b-app18-24.boldchat.com
  • b-app18-25.boldchat.com
  • b-app18-26.boldchat.com
  • b-app18-27.boldchat.com
  • b-app18-28.boldchat.com
  • b-app18-29.boldchat.com
  • b-app18-30.boldchat.com
  • b-app18-31.boldchat.com
  • b-app18-32.boldchat.com
  • b-app18-33.boldchat.com
  • b-app18-34.boldchat.com
  • b-app18-35.boldchat.com
  • b-app18-36.boldchat.com
  • b-app18-37.boldchat.com
  • b-app18-38.boldchat.com
  • b-app18-39.boldchat.com
  • b-app18-40.boldchat.com
  • b-app18-41.boldchat.com
  • b-app18-42.boldchat.com
  • b-app18-43.boldchat.com
  • b-app18-44.boldchat.com
  • b-app18-45.boldchat.com
  • b-app18-46.boldchat.com
  • b-app18-47.boldchat.com
  • b-app18-48.boldchat.com
  • b-app18-49.boldchat.com
  • b-app18-50.boldchat.com
  • b-app18-51.boldchat.com
  • b-app18-52.boldchat.com
  • b-app18-53.boldchat.com
  • b-app18-54.boldchat.com
  • b-app18-55.boldchat.com
  • b-app18-56.boldchat.com
  • b-app18-57.boldchat.com
  • b-app18-58.boldchat.com
  • b-app18-59.boldchat.com
  • b-app18-60.boldchat.com

US West (Oregon)

  • b-app19-01.boldchat.com
  • b-app19-02.boldchat.com
  • b-app19-03.boldchat.com
  • b-app19-04.boldchat.com
  • b-app19-05.boldchat.com
  • b-app19-06.boldchat.com
  • b-app19-07.boldchat.com
  • b-app19-08.boldchat.com
  • b-app19-09.boldchat.com
  • b-app19-10.boldchat.com
  • b-app19-11.boldchat.com
  • b-app19-12.boldchat.com
  • b-app19-13.boldchat.com
  • b-app19-14.boldchat.com
  • b-app19-15.boldchat.com
  • b-app19-16.boldchat.com
  • b-app19-17.boldchat.com
  • b-app19-18.boldchat.com
  • b-app19-19.boldchat.com
  • b-app19-20.boldchat.com
  • b-app19-21.boldchat.com
  • b-app19-22.boldchat.com
  • b-app19-23.boldchat.com
  • b-app19-24.boldchat.com
  • b-app19-25.boldchat.com
  • b-app19-26.boldchat.com
  • b-app19-27.boldchat.com
  • b-app19-28.boldchat.com
  • b-app19-29.boldchat.com
  • b-app19-30.boldchat.com
  • b-app19-31.boldchat.com
  • b-app19-32.boldchat.com
  • b-app19-33.boldchat.com
  • b-app19-34.boldchat.com
  • b-app19-35.boldchat.com
  • b-app19-36.boldchat.com
  • b-app19-37.boldchat.com
  • b-app19-38.boldchat.com
  • b-app19-39.boldchat.com
  • b-app19-40.boldchat.com
  • b-app19-41.boldchat.com
  • b-app19-42.boldchat.com
  • b-app19-43.boldchat.com
  • b-app19-44.boldchat.com
  • b-app19-45.boldchat.com
  • b-app19-46.boldchat.com
  • b-app19-47.boldchat.com
  • b-app19-48.boldchat.com
  • b-app19-49.boldchat.com
  • b-app19-50.boldchat.com
  • b-app19-51.boldchat.com
  • b-app19-52.boldchat.com
  • b-app19-53.boldchat.com
  • b-app19-54.boldchat.com
  • b-app19-55.boldchat.com
  • b-app19-56.boldchat.com
  • b-app19-57.boldchat.com
  • b-app19-58.boldchat.com
  • b-app19-59.boldchat.com
  • b-app19-60.boldchat.com
     

[ACTION] - If you allow-list Agent (formerly known as BoldChat) by IP, here are the IPs you will need to allow list in your organization in order to avoid connectivity issues with the new Data Center on March 5th:

Ireland

  • 34.246.13.84
  • 54.155.23.252
  • 46.137.48.149
  • 34.254.28.102 5
  • 2.49.80.82
  • 63.33.229.51
  • 54.75.218.75
  • 54.216.206.26
  • 34.246.145.123
  • 52.212.90.186 5
  • 4.77.148.81
  • 34.251.74.92

Frankfurt

  • 3.122.210.241
  • 18.192.113.151
  • 3.68.175.68
  • 18.196.140.195
  • 3.68.178.202
  • 18.194.200.171
  • 18.198.110.95
  • 18.192.7.127
  • 3.65.55.253
  • 3.64.238.21
  • 3.64.109.185
  • 18.198.123.19

US East (N. Virginia)

  • 107.20.174.150
  • 18.214.187.122
  • 18.233.1.191
  • 18.233.79.13
  • 18.233.95.16
  • 18.235.217.246
  • 23.20.109.244
  • 23.20.253.55
  • 23.21.167.45
  • 3.225.82.217
  • 3.231.116.10
  • 3.233.101.193
  • 3.233.111.68
  • 3.89.11.143
  • 34.194.220.164
  • 34.195.70.224
  • 34.206.233.8
  • 34.224.220.30
  • 34.228.50.168
  • 34.230.132.34
  • 34.234.140.16
  • 34.236.195.183
  • 34.236.241.191
  • 34.236.83.24
  • 35.153.29.169
  • 35.168.4.139
  • 35.174.34.186
  • 35.175.163.252
  • 44.193.104.84
  • 44.193.127.42
  • 44.193.247.199
  • 44.194.100.181
  • 44.194.137.67
  • 44.194.208.207
  • 44.194.25.105
  • 44.194.73.45
  • 44.195.9.217
  • 52.20.221.203
  • 52.207.76.221
  • 52.3.185.243
  • 52.44.154.238
  • 52.71.46.102
  • 52.71.71.29
  • 52.86.214.10
  • 54.144.250.111
  • 54.147.215.157
  • 54.152.188.62
  • 54.156.114.221
  • 54.156.48.172
  • 54.160.133.4
  • 54.160.196.54
  • 54.161.46.241
  • 54.163.230.72
  • 54.164.146.233
  • 54.166.248.29
  • 54.198.148.121
  • 54.226.231.169
  • 54.236.144.76
  • 54.84.163.19
  • 75.101.233.126

US West (Oregon)

  • 34.210.135.97
  • 34.213.254.212
  • 35.160.120.77
  • 35.161.150.98
  • 35.167.75.41
  • 35.80.158.24
  • 35.80.170.11
  • 35.80.194.13
  • 35.80.219.155
  • 35.81.101.126
  • 35.81.88.49
  • 35.82.204.234
  • 35.82.9.197
  • 35.83.116.129
  • 44.224.251.121
  • 44.226.244.84
  • 44.228.212.110
  • 44.230.126.250
  • 44.230.250.92
  • 44.231.153.96
  • 44.231.91.181
  • 44.232.19.77
  • 44.233.171.9
  • 44.237.129.5
  • 44.237.13.169
  • 44.237.28.122
  • 44.237.55.136
  • 44.238.219.222
  • 44.239.247.221
  • 44.241.208.142
  • 44.242.45.116
  • 44.242.53.108
  • 52.11.10.7
  • 52.12.160.123
  • 52.12.220.61
  • 52.13.124.118
  • 52.24.130.127
  • 52.32.198.76
  • 52.32.241.86
  • 52.35.142.151
  • 52.36.48.105
  • 52.38.106.12
  • 52.38.150.246
  • 52.40.239.227
  • 52.40.30.115
  • 52.41.198.141
  • 52.41.47.191
  • 54.184.129.107
  • 54.184.178.79
  • 54.184.90.24
  • 54.188.53.58
  • 54.200.230.213
  • 54.200.68.184
  • 54.201.26.44
  • 54.203.206.223
  • 54.212.170.137
  • 54.212.95.24
  • 54.69.131.234
  • 54.69.177.37
  • 54.69.85.11