Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
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