How to cross subdomains and keep chat open

If your customer has a shopping cart on a different sub domain, use this cookie to keep the chat going in the crossover

 

Instructions

give the customer this code:

<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://cdn-us-east.velaro.com/'
};
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: xxxxx,
groupId: 0,

cookieDomain: '.whateverthedomainis.com',
// customVars are optional.
customVars: {
exampleKey1: 'exampleValue1',
exampleKey2: 'exampleValue2'
}
});
}());
</script>


Was this article helpful?