var LC_API = LC_API || {}; const urlParams = new URLSearchParams(window.location.search.replace(/&/g, '&')); LC_API.on_after_load = function () { console.log('after load event'); console.log(ga.getAll()[0].get('clientId')); custom_variables = [ {name: 'site_for_invite', value: 'true'}, {name: 'utm_source', value: (!urlParams.get('utm_source')) ? 'Direct': urlParams.get('utm_source')}, {name: 'utm_medium', value: (!urlParams.get('utm_medium')) ? 'Direct': urlParams.get('utm_medium')}, {name: 'utm_campaign', value: urlParams.get("utm_campaign")}, {name: 'utm_content', value: urlParams.get("utm_content")}, {name: 'utm_term', value: urlParams.get("utm_term")}, {name: 'client_id', value: ga.getAll()[0].get('clientId')} ]; LC_API.set_custom_variables(custom_variables); }; window.__lc = window.__lc || {}; window.__lc.license =10791304; window.__lc.chat_between_groups = false; window.__lc.group = 257; window.__lc.ga_version = "gtm"; (function () { var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true; lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s); })();