Custom Data

Want to provide custom information about your website visitors to your agents? Do this by dynamically adding querystring parameters or any other known variables about your visitors to the scripts that you’ve deployed to your web pages. No additional setup or customization options are required. By simply adding any unique attribute/value parameters to all your Velaro scripts, that information is picked up by the visitor’s browser and passed along to Velaro so your agent can view it.

 

In order to pass in the information to your agents, we must either hard-code the value to be passed in the same every time, or the information must first be available on your website as a JavaScript variable specific to each user. This is usually information you already know about a customer such as a login name, cart value, or other information.

 

The code below is available at Account Setup > Design > Chat Designer > Actions > Deploy

 

In order to add your own custom variables, replace the highlighted portion below with your own Label:Value pairs. The Label can be any string you choose that will identify to your agents what the data means, and the Value has to match the name of the javascript variable in which that data is stored on your website. For example, if your website stores your customers names in a variable called CustomerName, then the Label:Value pair to add in the deployment script below would be something like Visitor Name: 'CustomerName' . If this is the pair that is used, agents will see the customers name in a row labelled Visitor Name in the custom data section of the engagement screen. 

 

<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 can be can be set up uniquely on each page if needed.

 

*If you are using the older Velaro legacy chat design, you will need to add, with an example for a hard-coded value pair and a variable value pair.

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

 

This piece of code will need to be added to your engagement script section and can be set up uniquely on each page if needed.

 


Was this article helpful?