Custom Data

To display custom data about website visitors to agents, query string parameters or any other known variables can be dynamically inserted into the chat engagement visitor information with scripts deployed to web pages where Velaro is installed.

Custom data variables in the visitor information panel

 

To display the data to agents and capture it in the chat transcript, the value can be hard-coded, or a variable specific to each visitor. This is usually information you already know about a customer such as a login name, account number, or other information.

To add custom data, replace the highlighted portion of the Velaro deployment script below with the required Label: Value pairs. The Label can be any string that will identify the data to agents. The Value must match the name of the data field. For example, if your website content management system stores customer names in a field called CustomerName, then the Label:Value pair to add in the deployment script below would be Account Number: ‘CustomerID’. Agents will see the customer ID in a row labeled Account Number in the custom data section of the visitor information panel. 

The code below is also available specific yoru account at Account Setup > Design > Chat Designer > Actions > Deploy

 

<script>

  (function () {

    var w = window; var d = document;

    if (w.Velaro) { return; }

    var v = function () { return v.c(arguments) };

    v.q = []; v.c = function (args) { v.q.push(args) }; w.Velaro = v;

    v.endpoints = {

      mainApi: 'https://api-main-us-east.velaro.com/',

      cdn: 'https://eastprodcdn.azureedge.net/'

    };

    w.addEventListener('load', function () {

      var s = d.createElement('script');

      s.type = 'text/javascript';

      s.async = true;

      s.src = v.endpoints.cdn + 'widgets/shim';

      var x = d.getElementsByTagName('script')[0];

      x.parentNode.insertBefore(s, x);

    });

 

    Velaro('boot', { 

      siteId: 11111,

      groupId: 0,

      // customVars are optional.

      customVars: {

        exampleKey1: 'exampleValue1',

        exampleKey2: 'exampleValue2'

      }

    });

  }());

</script>

 

This code can be configured on each page if needed.

 

If you are using the Velaro legacy chat window, the line to be modified on the deployment script is below: 

Velaro.Globals.CustomChatValues = { TestValue: “one” , TestValue2: x };


Was this article helpful?