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

From Genesys Documentation
Jump to: navigation, search
m (Text replacement - "\|Platform=([^\|]*)GenesysEngage-onpremises([\|]*)" to "|Platform=$1GenesysEngage-cloud$2")
(Published)
Line 6: Line 6:
 
|Dimension=WebActions
 
|Dimension=WebActions
 
|ComingSoon=No
 
|ComingSoon=No
|Platform=GenesysEngage-cloud, PureConnect, GenesysCloud
+
|Platform=PureConnect, GenesysCloud, GenesysEngage-cloud
|Prereq=
 
 
|Section={{Section
 
|Section={{Section
 +
|sectionHeading=About web messaging
 +
|anchor=WebMessaging
 +
|alignment=Vertical
 +
|structuredtext={{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.
 +
|Status=No
 +
}}{{Section
 
|sectionHeading=Event methods for web actions
 
|sectionHeading=Event methods for web actions
 
|anchor=WebActionMethods
 
|anchor=WebActionMethods
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=To capture information about events that occur during the lifecycle of a web action, use the Events methods shown in the following table.
 
|structuredtext=To capture information about events that occur during the lifecycle of a web action, use the Events methods shown in the following table.
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
Line 36: Line 39:
 
{{!}}}
 
{{!}}}
 
<br />
 
<br />
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 43: Line 44:
 
|anchor=WebActionMediaTypes
 
|anchor=WebActionMediaTypes
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<br />
 
|structuredtext=<br />
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
Line 61: Line 60:
 
{{!}}}
 
{{!}}}
 
<br />
 
<br />
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 68: Line 65:
 
|anchor=EventsWebActions
 
|anchor=EventsWebActions
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=The following table lists the events that you can use with {{Link-SomewhereInThisVersion|manual=SDK|topic=Use_Events_methods_with_web_actions|anchor=WebActionMethods|display text=Events methods for web actions}}. Event information returned includes the action state, customer ID, session ID, and action map ID.   
 
|structuredtext=The following table lists the events that you can use with {{Link-SomewhereInThisVersion|manual=SDK|topic=Use_Events_methods_with_web_actions|anchor=WebActionMethods|display text=Events methods for web actions}}. Event information returned includes the action state, customer ID, session ID, and action map ID.   
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
Line 117: Line 112:
 
{{!}}Error message for any exceptions caught during presentation of the action.
 
{{!}}Error message for any exceptions caught during presentation of the action.
 
{{!}}}
 
{{!}}}
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 124: Line 117:
 
|anchor=CaptureMore
 
|anchor=CaptureMore
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=The Web Action Events API can be used with Genesys Widgets commands to enrich events with more data that may be useful.
 
|structuredtext=The Web Action Events API can be used with Genesys Widgets commands to enrich events with more data that may be useful.
  
Line 139: Line 130:
 
});
 
});
 
</syntaxhighlight>{{NoteFormat|The data returned by WebChatService.getSessionData will differ based on your Genesys platform.}}
 
</syntaxhighlight>{{NoteFormat|The data returned by WebChatService.getSessionData will differ based on your Genesys platform.}}
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}
 
}}
 
}}
 
}}

Revision as of 13:21, December 15, 2020

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

Use Events methods to subscribe to events that occur during the lifecycle of Genesys Predictive Engagement web actions such as web chats and content offers. This raw data can be streamed to third-party analytics platforms or to tag management platform data layers for use in analytics and reporting platforms.

About web messaging

Feature coming soon: 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 web messaging feature to replace web chat.

Event methods for web actions

To capture information about events that occur during the lifecycle of a web action, use the Events methods shown in the following table.

Method Description

on

Subscribe to start receiving events for a given type of web action in a given state.

once

Receive events for only the first occurrence of a given type of web action in a given state.

off

Unsubscribe to stop receiving events for a given type of web action in a given state.


Media types, lifecycle states, and code examples using Events methods

Event types for web actions

The following table lists the events that you can use with Events methods for web actions. Event information returned includes the action state, customer ID, session ID, and action map ID.

Event Data type Description
actionId UUIDv4 Unique Id for a specific Predictive Engagement action.
actionState String Current state of the action. For example, offered.
actionMediaType String The engagement type. For example, webchat.
actionMapId UUIDv4 Id of the action map that qualified/triggered this action.
actionMapVersion Integer Version of the action map.
customerId UUIDv4 Stable identifier of the customer. For example, a cookie Id.
customerIdType String The specific type of customer identifier (always "cookie").
sessionId UUIDv4 Identifier of the customer's current web session.
errorCode Integer Status code for any exceptions caught during presentation of the action.
errorMessage String Error message for any exceptions caught during presentation of the action.

Capture more data with Genesys widgets

The Web Action Events API can be used with Genesys Widgets commands to enrich events with more data that may be useful.

For example, the Genesys Cloud conversationId may be useful in an analytics context. For more information on the Widgets API, see API Commands.
ac('on', 'webchat:all', (evt) => {
  _genesys.widgets.bus.command('WebChatService.getSessionData').then((data) => {
    if (data.conversationId) {
      evt.conversationId = data.conversationId;
    }

    someAnalyticsProvider.send(evt);
  })
});
Important
The data returned by WebChatService.getSessionData will differ based on your Genesys platform.
Comments or questions about this documentation? Contact us for support!