Skip to content

Instantly share code, notes, and snippets.

@lizardking8610
Created May 7, 2019 14:15
Show Gist options
  • Save lizardking8610/8b860a68ef224408eb3e194bd56792c7 to your computer and use it in GitHub Desktop.
Save lizardking8610/8b860a68ef224408eb3e194bd56792c7 to your computer and use it in GitHub Desktop.
Continually Chatbot Google Analytics Tracking
<!-- GA Tracking events with Continually JS API -->
<script>
continually.on('ready', function(api) {
api.on('startConversation', function(event) {
ga('send', 'event', {
eventCategory: 'Continually Conversations',
eventAction: 'Started Conversation',
eventLabel: event.conversationId,
});
});
api.on('emailCapture', function(event) {
ga('send', 'event', {
eventCategory: 'Continually Conversations',
eventAction: 'Email captured',
eventLabel: event.conversationId,
});
gtag_report_conversion('http://example.com/your-link');
});
});
</script>
<!-- End GA Tracking events -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment