Difference between revisions of "ATC/Current/SDK/Use Events methods with content offers"
From Genesys Documentation
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 | + | |Platform=PureConnect, GenesysCloud, GenesysEngage-cloud |
− | |||
|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=Subscribe to offered events | |sectionHeading=Subscribe to offered events | ||
|anchor=COOffered | |anchor=COOffered | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=<syntaxhighlight lang="javascript"> | |structuredtext=<syntaxhighlight lang="javascript"> | ||
ac('on', 'contentoffer:offered', (event) => { | ac('on', 'contentoffer:offered', (event) => { | ||
Line 20: | Line 23: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 27: | Line 28: | ||
|anchor=COAccepted | |anchor=COAccepted | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=<syntaxhighlight lang="javascript"> | |structuredtext=<syntaxhighlight lang="javascript"> | ||
ac('on', 'contentoffer:accepted', (event) => { | ac('on', 'contentoffer:accepted', (event) => { | ||
Line 34: | Line 33: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 41: | Line 38: | ||
|anchor=CORejected | |anchor=CORejected | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=<syntaxhighlight lang="javascript"> | |structuredtext=<syntaxhighlight lang="javascript"> | ||
ac('on', 'contentoffer:rejected', (event) => { | ac('on', 'contentoffer:rejected', (event) => { | ||
Line 48: | Line 43: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 55: | Line 48: | ||
|anchor=COIgnored | |anchor=COIgnored | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=<syntaxhighlight lang="javascript"> | |structuredtext=<syntaxhighlight lang="javascript"> | ||
ac('on', 'contentoffer:ignored', (event) => { | ac('on', 'contentoffer:ignored', (event) => { | ||
Line 62: | Line 53: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 69: | Line 58: | ||
|anchor=COErrored | |anchor=COErrored | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=<syntaxhighlight lang="javascript"> | |structuredtext=<syntaxhighlight lang="javascript"> | ||
ac('on', 'contentoffer:errored', (event) => { | ac('on', 'contentoffer:errored', (event) => { | ||
Line 76: | Line 63: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 83: | Line 68: | ||
|anchor=COAll | |anchor=COAll | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=<syntaxhighlight lang="javascript"> | |structuredtext=<syntaxhighlight lang="javascript"> | ||
ac('on', 'contentoffer:all', (event) => { | ac('on', 'contentoffer:all', (event) => { | ||
Line 90: | Line 73: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 97: | Line 78: | ||
|anchor=COUnsubscribe | |anchor=COUnsubscribe | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=<syntaxhighlight lang="javascript"> | |structuredtext=<syntaxhighlight lang="javascript"> | ||
ac('off', 'contentoffer:offered', eventHandler); // unsubscribes `eventHandler` from 'contentoffer:offered' events | ac('off', 'contentoffer:offered', eventHandler); // unsubscribes `eventHandler` from 'contentoffer:offered' events | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
|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.
Contents
See examples how how to use Events methods with content offers.
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.
Subscribe to offered events
ac('on', 'contentoffer:offered', (event) => {
console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});
Subscribe to accepted events
ac('on', 'contentoffer:accepted', (event) => {
console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});
Subscribe to rejected events
ac('on', 'contentoffer:rejected', (event) => {
console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});
Subscribe to ignored events
ac('on', 'contentoffer:ignored', (event) => {
console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});
Subscribe to errored events
ac('on', 'contentoffer:errored', (event) => {
console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});
Subscribe to all content offer events
ac('on', 'contentoffer:all', (event) => {
console.log('received %s:%s event', event.actionMediaType, event.actionState, event);
});
Unsubscribe from content offers in the offered state
ac('off', 'contentoffer:offered', eventHandler); // unsubscribes `eventHandler` from 'contentoffer:offered' events
Comments or questions about this documentation? Contact us for support!