The integration of Roistat with YCLIENTS works with records and contacts.
Install the Roistat tracking code on every page of your website that is visited by your customers. The tracking code is needed to receive information about the visits. To learn more about the tracking code installation, read this article.
Find the following code of YCLIENTS:
<script type="text/javascript" src="https://wXXXXX.yclients.com/widgetJS" charset="UTF-8"></script> |
where wXXXXX - is your form ID.
Change it to the following code:
<script> window.roistatVisitCallback = function(visitId) { document.cookie = 'yextrafield_roistat=' + visitId; var script = document.createElement('script'); script.src = "https://wXXXXX.yclients.com/widgetJS"; document.getElementsByTagName('body')[0].appendChild(script); }; </script> |
Insert your form ID instead of wXXXXX.
To add the additional field, login to YCLIENTS and open Analytics → Integration with Roistat.
The additional field should be named roistat, otherwise, the integration won't work.
If you create a lead manually, you can fill in the "roistat" field with the data of the source of the lead. The information about the source of the lead will be displayed in Analytics.
To bind the lead to the specified marketing channel, enter the following markers in the roistat field:
Enter the email address or telephone number of your account in the Login field. The number should be entered in the following format: 1xxxxxxxxxx. Make sure that this user is added in the configurations of the main net and has admin acces.
a. Determine the main network of the branch. To do it, open the interface of the branch and open Settings → Networks. b. Go to the settings of the main network and open Settings → Users. Verify if the user is added to the network configuration and has the full access rights. |
b. Enter your account password in the Login field.
Enter the IDs of your managers in the Deals responsible managers field.
|
Enter the ID of the company of your responsible managers in the Company of the responsible managers field.
To find out the ID of the company, open Browse → Report. You will see the ID of the company in the Branch ID field.
Enter the following code into the HTML code field:
<script> (function(w, d, s, h, id) { w.roistatProjectId = id; w.roistatHost = h; var p = d.location.protocol == "https:" ? "https://" : "http://"; var u = /^.*roistat_visit=[^;]+(.*)?$/.test(d.cookie) ? "/dist/module.js" : "/api/site/1.0/"+id+"/init"; var js = d.createElement(s); js.charset="UTF-8"; js.async = 1; js.src = p+h+u; var js2 = d.getElementsByTagName(s)[0]; js2.parentNode.insertBefore(js, js2); })(window, document, 'script', 'cloud.roistat.com', 'tracking code key'); </script> <script> window.onRoistatModuleLoaded = function () { var params = window .location .search .replace('?','') .split('&') .reduce( function(p,e){ var a = e.split('='); p[ decodeURIComponent(a[0])] = decodeURIComponent(a[1]); return p; }, {} ); if (params['yextrafield_roistat']) { window.roistat.setVisit(params['yextrafield_roistat']); } }; window.roistatVisitCallback = function (visitId) { console.log('visitId', visitId); window.yclientsAdditionalOptions = { bookingCustomFields: { roistat: visitId } }; }; </script> |
and enter the roistat tracking code key instead of 'tracking code field' using the ' ' brackets.
If you use the third-party forms (besides of YCLIENTS widget), we recommend you to configure the transmission of leads to CRM via Roistat. Read more in this article.
If the transmission of deals from website to CRM is already configured with the help of your code, fill in the additional field "roistat" with the browser cookie roistat_visit.
Here is the code you can use to receive the value of this cookie:
|