Last active
October 28, 2019 20:29
-
-
Save ryanpraski/60dc1f465b2290bfc23214caea4220ad to your computer and use it in GitHub Desktop.
Zendesk chat formerly know as Zopim chat connected, chat start, chat end tracking in Adobe Launch and Google Tag Manager (GTM). See more events for the chat api here: https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html
This file contains 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
try { | |
$(document).ready(function() { | |
if (typeof zE != 'undefined') { | |
zE(function() { | |
$zopim(function() { | |
$zopim.livechat.setOnConnected(function() { | |
//console.log("zendesk chat connected"); | |
//trigger(); | |
_satellite.track('zendeskChatConnected'); | |
dataLayer.push({ | |
'event': 'zendeskChatConnected', | |
}); | |
}) | |
}) | |
$zopim(function() { | |
$zopim.livechat.setOnChatStart(function() { | |
//console.log("zendesk chat started"); | |
//trigger(); | |
_satellite.track('zendeskChatStart'); | |
dataLayer.push({ | |
'event': 'zendeskChatStart', | |
}); | |
}) | |
}) | |
$zopim(function() { | |
$zopim.livechat.setOnChatEnd(function() { | |
//console.log("zendesk chat ended"); | |
//trigger(); | |
_satellite.track('zendeskChatEnd'); | |
dataLayer.push({ | |
'event': 'zendeskChatEnd', | |
}); | |
}) | |
}) | |
}); | |
} | |
}); | |
} catch (err) { | |
console.log(err.message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment