Difference between revisions of "ATC/Current/SDK/Init"

From Genesys Documentation
Jump to: navigation, search
(Published)
m (Text replacement - "Genesys Cloud" to "Genesys Cloud CX")
 
(17 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
|Standalone=No
 
|Standalone=No
 
|DisplayName=init
 
|DisplayName=init
|Platform=PureEngage, PureConnect, PureCloud
 
 
|TocName=init
 
|TocName=init
 +
|Context=Learn how to use the <tt>init</tt> method to initialize the Journey JavaScript SDK.
 +
|Dimension=initialization methods
 
|ComingSoon=No
 
|ComingSoon=No
|Context=The <tt>init</tt> method initializes the {{MINTYDOCSPRODUCT}} SDK.
+
|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 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=Description
 
|sectionHeading=Description
|Type=Structured
 
 
|alignment=Vertical
 
|alignment=Vertical
|gif=No
+
|structuredtext=The <tt>init</tt> method initializes the Journey JavaScript SDK.
|structuredtext=The i<tt>nit</tt> method initializes the {{MINTYDOCSPRODUCT}} SDK.
+
{{NoteFormat|For GDPR compliance, obtain a customer's consent before you call the <tt>init</tt> method. For more information about how to use {{MINTYDOCSPRODUCT}} in a GDPR-compliant manner, see {{#mintydocs_link:manual=AdminGuide|topic=GDPR|link text=GDPR}}. |1}}
 
 
 
 
{{NoteFormat|For GDPR compliance, be sure to obtain a customer's consent before you call the <tt>init</tt> method. For more information about how to use {{MINTYDOCSPRODUCT}} in a GDPR-compliant manner, see {{#mintydocs_link:manual=AdminGuide|topic=GDPR|link text=GDPR}}. |1}}
 
|fullwidth=No
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
 
|sectionHeading=Signature
 
|sectionHeading=Signature
|Type=Unstructured
+
|alignment=Vertical
|freetext=<tt>ac('init', organisationId, options)</tt>
+
|structuredtext=<tt>ac('init', organisationId, options)</tt>
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
 
|sectionHeading=Arguments
 
|sectionHeading=Arguments
|Type=Unstructured
+
|alignment=Vertical
|freetext=* [[#organizationID|organizationId]]
+
|structuredtext=*[[#organizationID|organizationId]]
* [[#options|options]]
+
*[[#options|options]]
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
 
|sectionHeading=organizationId
 
|sectionHeading=organizationId
|Type=Unstructured
 
 
|anchor=organizationID
 
|anchor=organizationID
|freetext=* Description: your organization's unique ID, which you can get from [https://app.genesys.cloud/journey/admin/#/settings/tracking-snippet https://app.genesys.cloud/journey/admin/#/settings/tracking-snippet].
+
|alignment=Vertical
* Type: string
+
|structuredtext=*'''Description:''' Your organization's unique ID. {{Link-SomewhereInThisVersion|manual=SDK|topic=Init|anchor=FindOrgRegion|display text=Find your organization ID}}
* Status: required
+
*'''Type:''' String
 +
*'''Status:''' Required
 +
 
 +
<br /><br />
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
 
|sectionHeading=options
 
|sectionHeading=options
|Type=Structured
 
 
|anchor=options
 
|anchor=options
 
|alignment=Vertical
 
|alignment=Vertical
|gif=No
+
|structuredtext={{NoteFormat|For detailed explanations of how you can use these options to configure tracking, see {{Link-SomewhereInThisVersion|manual=SDK|topic=Configure_advanced_tracking}}.|2}}
|structuredtext=* Description: configures the SDK with its region and other known default options.
+
 
* Type: object
+
*'''Description:''' Configures the Journey JavaScript SDK with its region and other known default options.
* Status: required
+
*'''Type:''' Object
* Properties:
+
*'''Status:''' Required
 +
*'''Properties:''' See the following table.
 +
 
 
{{{!}} class="wikitable" style="width: 1150px;" data-mce-style="width: 1150px;"
 
{{{!}} class="wikitable" style="width: 1150px;" data-mce-style="width: 1150px;"
 
{{!}}-
 
{{!}}-
Line 55: Line 58:
 
{{!}}-
 
{{!}}-
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}region
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}region
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Your organization's regions, which you can obtain from [https://app.genesys.cloud/journey/admin/#/settings/tracking-snippet https://app.genesys.cloud/journey/admin/#/settings/tracking-snippet]
+
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Your organization's region. {{Link-SomewhereInThisVersion|manual=SDK|topic=Init|anchor=FindOrgRegion|display text=Find your region ID}}
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}String
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}String
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Required
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Required
Line 61: Line 64:
 
{{!}}-
 
{{!}}-
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}cookieDomain
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}cookieDomain
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Sets a custom cookie domain
+
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Sets a custom cookie domain.
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}String
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}String
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
Line 67: Line 70:
 
{{!}}-
 
{{!}}-
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}cookieExpires
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}cookieExpires
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Sets a time in seconds for a customer's cookie to expire
+
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Sets a time in seconds for a visitor's cookie to expire.
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Number
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Number
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
Line 73: Line 76:
 
{{!}}-
 
{{!}}-
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}cookiePrefix
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}cookiePrefix
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Sets a custom cookie prefix
+
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Sets a custom cookie prefix.
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}String
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}String
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
Line 79: Line 82:
 
{{!}}-
 
{{!}}-
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}autoLink
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}autoLink
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}An array of domains whose outbound links will be modified to contain tracking information
+
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}An array of domains whose outbound links will be modified to contain tracking information. For an example, see {{Link-SomewhereInThisVersion|manual=SDK|topic=Configure_advanced_tracking|display text=Configure advanced tracking.}}
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Array of strings
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Array of strings
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
Line 85: Line 88:
 
{{!}}-
 
{{!}}-
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}allowedLinkers
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}allowedLinkers
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}An array of domains whose inbound referral will set tracking information
+
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}An array of domains whose inbound referral will set tracking information. For an example, see {{Link-SomewhereInThisVersion|manual=SDK|topic=Configure_advanced_tracking|display text=Configure advanced tracking.}}
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Array of strings
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Array of strings
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
Line 91: Line 94:
 
{{!}}-
 
{{!}}-
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}canonicalLink
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}canonicalLink
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Uses canonical links
+
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Uses canonical links.
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Boolean
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Boolean
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
Line 97: Line 100:
 
{{!}}-
 
{{!}}-
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}globalTraitsMapper
 
{{!}} style="width: 210.535px;" data-mce-style="width: 210.535px;"{{!}}globalTraitsMapper
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Maps custom attributes to traits For more information, see{{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper|display text=Traits Mapper.}}
+
{{!}} style="width: 783.465px;" data-mce-style="width: 783.465px;"{{!}}Maps custom attributes to traits. For more information, see {{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper|display text=Traits Mapper.}}
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Array
 
{{!}} style="width: 42px;" data-mce-style="width: 42px;"{{!}}Array
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}}Optional
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}} 
 
{{!}} style="width: 62px;" data-mce-style="width: 62px;"{{!}} 
 
{{!}}}
 
{{!}}}
|fullwidth=No
+
|Status=No
 +
}}{{Section
 +
|sectionHeading=Find your org ID and region ID
 +
|anchor=FindOrgRegion
 +
|alignment=Horizontal
 +
|Media=Image
 +
|image=InitOrgIDRegionID.png
 +
|structuredtext=Go to '''Genesys Cloud CX''' > '''Admin''' > '''Tracking Snippet'''.
 +
|Status=No
 +
}}{{Section
 +
|sectionHeading=Region names and IDs
 +
|anchor=RegionNamesIDs
 +
|alignment=Vertical
 +
|structuredtext=The following table lists the available region names and corresponding IDs.
 +
{{{!}} class="wikitable"
 +
{{!}}+
 +
!Region name
 +
!ID
 +
{{!}}-
 +
{{!}}Americas (US West)
 +
{{!}}usw2
 +
{{!}}-
 +
{{!}}Americas (US East)
 +
{{!}}use1
 +
{{!}}-
 +
{{!}}Americas (Canada)
 +
{{!}}cac1
 +
{{!}}-
 +
{{!}}EMEA (Dublin)
 +
{{!}}euw1
 +
{{!}}-
 +
{{!}}EMEA (London)
 +
{{!}}euw2
 +
{{!}}-
 +
{{!}}EMEA (Frankfurt)
 +
{{!}}euc1
 +
{{!}}-
 +
{{!}}Asia Pacific (Tokyo)
 +
{{!}}apne1
 +
{{!}}-
 +
{{!}}Asia Pacific (Seoul)
 +
{{!}}apne2
 +
{{!}}-
 +
{{!}}Asia Pacific (Sydney)
 +
{{!}}apse2
 +
{{!}}}
 
|Status=No
 
|Status=No
 
}}
 
}}
 
}}
 
}}

Latest revision as of 21:27, November 9, 2021

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

Learn how to use the init method to initialize 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.

Description

The init method initializes the Journey JavaScript SDK.

Important
For GDPR compliance, obtain a customer's consent before you call the init method. For more information about how to use Genesys Predictive Engagement in a GDPR-compliant manner, see GDPR.

Signature

ac('init', organisationId, options)

Arguments

organizationId



options

Tip
For detailed explanations of how you can use these options to configure tracking, see Advanced tracking with cookies.
  • Description: Configures the Journey JavaScript SDK with its region and other known default options.
  • Type: Object
  • Status: Required
  • Properties: See the following table.
Name Description Type Status Default
region Your organization's region. Find your region ID String Required  
cookieDomain Sets a custom cookie domain. String Optional Highest level domain possible
cookieExpires Sets a time in seconds for a visitor's cookie to expire. Number Optional 31536000 (1 year)
cookiePrefix Sets a custom cookie prefix. String Optional  
autoLink An array of domains whose outbound links will be modified to contain tracking information. For an example, see Configure advanced tracking. Array of strings Optional  
allowedLinkers An array of domains whose inbound referral will set tracking information. For an example, see Configure advanced tracking. Array of strings Optional  
canonicalLink Uses canonical links. Boolean Optional False
globalTraitsMapper Maps custom attributes to traits. For more information, see Traits Mapper. Array Optional  

Find your org ID and region ID

Go to Genesys Cloud CX > Admin > Tracking Snippet.

Region names and IDs

The following table lists the available region names and corresponding IDs.

Region name ID
Americas (US West) usw2
Americas (US East) use1
Americas (Canada) cac1
EMEA (Dublin) euw1
EMEA (London) euw2
EMEA (Frankfurt) euc1
Asia Pacific (Tokyo) apne1
Asia Pacific (Seoul) apne2
Asia Pacific (Sydney) apse2
Retrieved from "https://all.docs.genesys.com/ATC/Current/SDK/Init (2025-06-19 06:35:24)"
Comments or questions about this documentation? Contact us for support!