Difference between revisions of "ATC/Current/SDK/Use Events methods with web chats"

From Genesys Documentation
Jump to: navigation, search
(Published)
(Published)
Line 3: Line 3:
 
|DisplayName=Examples: Events methods with web chats
 
|DisplayName=Examples: Events methods with web chats
 
|TocName=Web chats examples
 
|TocName=Web chats examples
|Context=See examples of how to use Events methods with web chats.{{BarbFeatureTemp|Feature=Web messaging}}This article only applies to customers using web chat. If you are a Genesys Cloud customer, we encourage you to use the new {{Link-AnywhereElse|product=ATC|version=Current|manual=AdminGuide|topic=About_web_messaging|display text=web messaging}} feature to replace web chat.
+
|Context=See examples of how to use Events methods with web chats.
 
|Dimension=WebActions
 
|Dimension=WebActions
 
|ComingSoon=No
 
|ComingSoon=No
 
|Platform=PureConnect, GenesysCloud, GenesysEngage-cloud
 
|Platform=PureConnect, GenesysCloud, GenesysEngage-cloud
 
|Section={{Section
 
|Section={{Section
 +
|alignment=Vertical
 +
|structuredtext={{NoteFormat|1=This article only applies to customers using {{Link-AnywhereElse|product=ATC|version=Current|manual=AdminGuide|topic=About_web_chats|display text=web chat}}. If you are a Genesys Cloud customer, we encourage you to use the new {{Link-AnywhereElse|product=ATC|version=Current|manual=AdminGuide|topic=About_web_messaging|display text=web messaging}} feature to replace web chat.|2=}}<br />
 +
|Status=No
 +
}}{{Section
 
|sectionHeading=Subscribe to offered events
 
|sectionHeading=Subscribe to offered events
 
|anchor=WCOffered
 
|anchor=WCOffered

Revision as of 10:37, August 10, 2021

This topic is part of the manual Journey JavaScript SDK for version Current of Genesys Predictive Engagement.

See examples of how to use Events methods with web chats.

Important
This article only applies to customers using web chat. If you are a Genesys Cloud customer, we encourage you to use the new web messaging feature to replace web chat.

Subscribe to offered events

ac('on', 'webchat:offered', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to accepted events

ac('on', 'webchat:accepted', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to started events

ac('on', 'webchat:started', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to engaged events

ac('on', 'webchat:engaged', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to rejected events

ac('on', 'webchat:rejected', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to ignored events

ac('on', 'webchat:ignored', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to errored events

ac('on', 'webchat:errored', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to timedout events

ac('on', 'webchat:timedout', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Subscribe to all web chat events

ac('on', 'webchat:all', (event) => {
  console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});

Unsubscribe from web chats in the offered state

ac('off', 'webchat:offered', eventHandler); // unsubscribes `eventHandler` from 'webchat:offered' events
Comments or questions about this documentation? Contact us for support!