Difference between revisions of "ATC/Current/SDK/Method reference"

From Genesys Documentation
Jump to: navigation, search
(Published)
 
(9 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
|DisplayName=Method reference
 
|DisplayName=Method reference
 
|TocName=Method reference
 
|TocName=Method reference
|Context=View a list of all methods in the Journey JavaScript SDK.
+
|Context=View a list of methods available in the Journey JavaScript SDK.
 
|ComingSoon=No
 
|ComingSoon=No
|Platform=PureEngage, PureConnect, PureCloud
+
|Platform=PureConnect, GenesysCloud, GenesysEngage-cloud
|Prereq=
 
 
|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 CX 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=Initialization methods
 
|sectionHeading=Initialization methods
|anchor=
 
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
+
|structuredtext=For more information about a method, including signature and arguments, click the method's name.
|image=
 
|structuredtext=For complete information about a method, including signature and arguments, click the method's name.
 
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
 
{{!}}-
 
{{!}}-
Line 20: Line 20:
 
{{!}}-
 
{{!}}-
 
{{!}}{{!}}{{#mintydocs_link:topic=Init|link text=init}}
 
{{!}}{{!}}{{#mintydocs_link:topic=Init|link text=init}}
{{!}}{{!}}Initializes the {{MINTYDOCSPRODUCT}} SDK
+
{{!}}{{!}}Initializes the Journey JavaScript SDK.
 +
{{!}}-
 +
{{!}}{{Link-SomewhereInThisVersion|manual=SDK|topic=initialized}}
 +
{{!}}Notifies when the Journey JavaScript SDK is initialized fully.
 
{{!}}-
 
{{!}}-
 
{{!}}{{!}}{{#mintydocs_link:topic=Destroy|link text=destroy}}
 
{{!}}{{!}}{{#mintydocs_link:topic=Destroy|link text=destroy}}
{{!}}{{!}}Stops all {{MINTYDOCSPRODUCT}} SDK activity and removes all tracking information
+
{{!}}{{!}}Stops all Journey JavaScript SDK activity and removes all tracking information.
 
{{!}}}
 
{{!}}}
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
|sectionHeading=Tracking methods
+
|sectionHeading=Session methods
|anchor=
+
|anchor=SessionMethods
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
+
|structuredtext=For more information about a method, including signature and arguments, click the method's name.
|image=
 
|structuredtext=For complete information about a method, including signature and arguments, click the method's name.
 
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
 
{{!}}-
 
{{!}}-
Line 40: Line 39:
 
{{!}}{{!}}'''Description'''
 
{{!}}{{!}}'''Description'''
 
{{!}}-
 
{{!}}-
{{!}}{{!}}{{#mintydocs_link:topic=Pageview|link text=pageview}}
+
{{!}}{{!}}{{Link-SomewhereInThisVersion|manual=SDK|topic=api.session.getData}}
{{!}}{{!}}Tracks page views
+
{{!}}{{!}}Returns an object that contains session information.
{{!}}-
 
{{!}}{{!}}{{#mintydocs_link:topic=Record|link text=record}}
 
{{!}}{{!}}Records custom website events
 
 
{{!}}-
 
{{!}}-
{{!}}{{!}}{{#mintydocs_link:topic=Identify|link text=identify}}
+
{{!}}{{!}}{{Link-SomewhereInThisVersion|manual=SDK|topic=api.session.getCustomerCookieId}}
{{!}}{{!}}Adds information to a customer
+
{{!}}{{!}}Returns a string that contains the customer cookie ID.
 
{{!}}-
 
{{!}}-
{{!}}{{!}}{{#mintydocs_link:topic=Forms:track|link text=forms:track}}
+
{{!}}{{Link-SomewhereInThisVersion|manual=SDK|topic=api.session.getId}}
{{!}}{{!}} 
+
{{!}}Returns a string containing session ID.
{{!}}}
+
{{!}}}<br />
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
|sectionHeading=Utility methods
+
|sectionHeading=Tracking methods
|anchor=
+
|anchor=TrackingMethods
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
+
|structuredtext=For more information about a method, including signature and arguments, click the method's name.
|image=
 
|structuredtext=For complete information about a method, click the method's name.
 
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
 
{{!}}-
 
{{!}}-
Line 67: Line 59:
 
{{!}}{{!}}'''Description'''
 
{{!}}{{!}}'''Description'''
 
{{!}}-
 
{{!}}-
{{!}}{{!}}
+
{{!}}{{!}}{{#mintydocs_link:topic=Pageview|link text=pageview}}
{{Link-SomewhereInThisManual|topic=serialize}}<br />
+
{{!}}{{!}}Tracks page views.
{{!}}{{!}}Used for passing serialized data from a form.
 
 
{{!}}-
 
{{!}}-
{{!}}{{!}}{{Link-SomewhereInThisManual|topic=dom_-_ready}}<br />
+
{{!}}{{!}}{{#mintydocs_link:topic=Record|link text=record}}
{{!}}{{!}}Allows you specify a function handler to run when the DOM has fully loaded.
+
{{!}}{{!}}Records custom website events.
 
{{!}}-
 
{{!}}-
{{!}}{{!}}{{Link-SomewhereInThisManual|topic=debug}}<br />
+
{{!}}{{!}}{{#mintydocs_link:topic=Forms:track|link text=forms:track}}
{{!}}{{!}}Sends helpful messages to the console.
+
{{!}}{{!}} Captures when visitors complete web-based forms.
 
{{!}}}
 
{{!}}}
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
|sectionHeading=Visit API methods
+
|sectionHeading=Events methods
|anchor=
+
|anchor=EventsMethods
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
+
|structuredtext=For more information about a method, including signature and arguments, click the method's name.
|image=
+
{{{!}} class="wikitable"
|structuredtext={{{!}} class="wikitable"
 
 
{{!}}-
 
{{!}}-
{{!}}{{!}}'''Name'''
+
{{!}}{{!}}'''Method'''
 
{{!}}{{!}}'''Description'''
 
{{!}}{{!}}'''Description'''
 
{{!}}-
 
{{!}}-
{{!}}{{!}}ac('api.visit.get', callback)<br />
+
{{!}}{{!}}{{Link-SomewhereInThisVersion|manual=SDK|topic=on}}
{{!}}{{!}}Performs an AJAX request to retrieve the session data from the {{MINTYDOCSPRODUCT}} server. The object returned contains the most up-to-date data for the session. This is useful for monitoring live data, such as segment assigned IDs, outcome score progress, and last page viewed.<br />
+
{{!}}{{!}}Subscribes to notifications about a particular type of Journey JavaScript SDK activity.
 
{{!}}-
 
{{!}}-
{{!}}{{!}}ac('api.visit.cached', callback)<br />
+
{{!}}{{!}}{{Link-SomewhereInThisVersion|manual=SDK|topic=once}}
{{!}}{{!}}Retrieves the cached {{MINTYDOCSPRODUCT}} session data from the browser local storage. If session data does not exist in local storage, a session will be requested via an AJAX request from {{MINTYDOCSPRODUCT}}. This is practical for retrieving data that doesn't change for a session, such as the visit identifier, device details, location, referrer, and marketing campaign information.<br />
+
{{!}}{{!}}Subscribes to notifications for first event for a particular type of Journey JavaScript SDK activity.
 
{{!}}-
 
{{!}}-
{{!}}{{!}}ac('api.visit.getShortId', callback)<br />
+
{{!}}{{Link-SomewhereInThisVersion|manual=SDK|topic=off}}
{{!}}{{!}}This provides the same functionality as<tt>'api.visit.cached'</tt>, but only the 'shortId' is returned. The short ID is useful as a legible reference number that can be displayed on the website.<br />
+
{{!}}Unsubscribes from notifications about a particular type of Journey JavaScript SDK activity.
 
{{!}}}
 
{{!}}}
|structuredtextwide=
+
|Status=No
|FAQHeading=
 
|Status=Yes
 
 
}}{{Section
 
}}{{Section
|sectionHeading=Customer API methods
+
|sectionHeading=Utility methods
|anchor=
+
|anchor=UtilityMethods
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
+
|structuredtext=For more information about a method, click the method's name.
|image=
+
{{{!}} class="wikitable"
|structuredtext={{{!}} class="wikitable" style="font-size: 14px;"
 
 
{{!}}-
 
{{!}}-
{{!}}{{!}}'''Name'''
+
{{!}}{{!}}'''Method'''
 
{{!}}{{!}}'''Description'''
 
{{!}}{{!}}'''Description'''
 
{{!}}-
 
{{!}}-
{{!}}{{!}}ac('api.customer.get', callback)<br />
+
{{!}}{{!}}
{{!}}{{!}}This performs an AJAX request to retrieve the visitor data from the {{MINTYDOCSPRODUCT}} server.<br />
+
{{Link-SomewhereInThisManual|topic=serialize}}<br />
 +
{{!}}{{!}}Passes serialized data from a form.
 +
{{!}}-
 +
{{!}}{{!}}{{Link-SomewhereInThisManual|topic=dom_-_ready}}<br />
 +
{{!}}{{!}}Allows you to specify a function handler to run when the DOM has loaded fully.
 +
{{!}}-
 +
{{!}}{{!}}{{Link-SomewhereInThisManual|topic=debug}}<br />
 +
{{!}}{{!}}Sends helpful messages to the console.
 
{{!}}}
 
{{!}}}
|structuredtextwide=
+
|Status=No
|FAQHeading=
 
|Status=Yes
 
 
}}
 
}}
 
}}
 
}}

Latest revision as of 09:43, February 2, 2023

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

View a list of methods available in the Journey JavaScript SDK.

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

Initialization methods

For more information about a method, including signature and arguments, click the method's name.

Method Description
init Initializes the Journey JavaScript SDK.
initialized Notifies when the Journey JavaScript SDK is initialized fully.
destroy Stops all Journey JavaScript SDK activity and removes all tracking information.

Session methods

For more information about a method, including signature and arguments, click the method's name.

Method Description
api.session.getData Returns an object that contains session information.
api.session.getCustomerCookieId Returns a string that contains the customer cookie ID.
api.session.getId Returns a string containing session ID.

Tracking methods

For more information about a method, including signature and arguments, click the method's name.

Method Description
pageview Tracks page views.
record Records custom website events.
forms:track  Captures when visitors complete web-based forms.

Events methods

For more information about a method, including signature and arguments, click the method's name.

Method Description
on Subscribes to notifications about a particular type of Journey JavaScript SDK activity.
once Subscribes to notifications for first event for a particular type of Journey JavaScript SDK activity.
off Unsubscribes from notifications about a particular type of Journey JavaScript SDK activity.

Utility methods

For more information about a method, click the method's name.

Method Description

serialize

Passes serialized data from a form.
dom - ready
Allows you to specify a function handler to run when the DOM has loaded fully.
debug
Sends helpful messages to the console.
Retrieved from "https://all.docs.genesys.com/ATC/Current/SDK/Method_reference (2025-06-23 21:23:14)"
Comments or questions about this documentation? Contact us for support!