Last active
August 22, 2022 01:30
-
-
Save Deepwalker/a3ec6ee344bd7f637694 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'> | |
function jivo_onLoadCallback() { | |
var clientId = '00' + (Math.random() * 1000000000000000000) + '.' + (new Date()).getTime(); | |
ga(function (tracker) { | |
clientId = tracker.get('clientId'); // получение client id из Google Analytics | |
jivo_api.setUserToken(clientId); | |
if (console) console.log('cid from ga', clientId); | |
}) | |
jivo_api.setUserToken(clientId); | |
if (console) { | |
if (clientId.startsWith('00')) { | |
console.log('ga was not fired, generated cid was setup', clientId) | |
} else { | |
console.log('ga fired first, real cid', clientId) | |
} | |
} | |
}; | |
(function(){ var widget_id = '___CHANGEIT_WIDGET_ID___'; | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.async = true; | |
s.src = '//code.jivosite.com/script/widget/'+widget_id; | |
var ss = document.getElementsByTagName('script')[0]; | |
ss.parentNode.insertBefore(s, ss);})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment