Difference between revisions of "ATC/Current/SDK/Traits mapper"

From Genesys Documentation
Jump to: navigation, search
(Published)
 
(Published)
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Article
 
{{Article
 
|Standalone=No
 
|Standalone=No
|DisplayName=Traits mapper
+
|DisplayName=Map traits to link customer records
|Platform=PureEngage, PureConnect, PureCloud
+
|TocName=Map traits
|TocName=Traits mapper
+
|Context=Learn how to map multiple records for the same customer to see more complete customer profiles in Live Now.
 
|ComingSoon=No
 
|ComingSoon=No
|Context=The traits mapper links customer records together.
+
|Platform=PureConnect, GenesysCloud, GenesysEngage-cloud
 
|Section={{Section
 
|Section={{Section
|sectionHeading=About traits
+
|alignment=Vertical
|Type=Structured
+
|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=About traits mapping
 
|anchor=AboutTraits
 
|anchor=AboutTraits
 
|alignment=Vertical
 
|alignment=Vertical
|gif=No
+
|structuredtext=Traits are properties, such as a customer's email address or phone number. {{MINTYDOCSPRODUCT}} gathers customer traits every time a customer visits a website that you track with the {{MINTYDOCSPRODUCT}} tracking snippet. It's possible to have multiple customer records for the same person. For example, when a customer visits your website multiple times and uses a different browser each time. Because {{MINTYDOCSPRODUCT}} creates a separate record for each instance, the separate customer records may contain only a subset of all the available customer traits. You can map the traits that the separate customer records contain to link the records. Then, you can see the complete customer information in Live Now.
|structuredtext=Traits are properties of a customer. For example, "email," and "gender."
 
{{MINTYDOCSPRODUCT}} gathers trait information every time a customer visits a website that you track with the {{MINTYDOCSPRODUCT}} tracking snippet.
 
  
If multiple records for the same customer exist, you can link them with the traits mapper.
+
{{NoteFormat|When the traits mapper links customer records, it preserves the separate customer records. It doesn't consolidate them into a single customer record. Instead, the traits mapper updates all linked customer records with the current traits information.|}}
 +
 
 +
After linking customer records, the traits mapper updates all the records when new trait information becomes available. It overwrites existing or duplicate traits with the most current trait information.
 +
|Status=No
 +
}}{{Section
 +
|sectionHeading=View mapped traits in the user interface
 +
|anchor=ViewMappedTraits
 +
|alignment=Horizontal
 +
|Media=Image
 +
|image=TraitsMapper1.png
 +
|structuredtext=After you map traits, they appear here:
  
 +
*Genesys Cloud CX > Admin menu > Live Now > {{Link-SomewhereInThisVersion|manual=AdminGuide|topic=Customer_details}}
 +
*Agent user interface > Journey gadget >
 +
**{{Link-AnywhereElse|product=ATC|version=Current|manual=AgentGuide|topic=GenesysEngage|anchor=VisitorInfo|display text=Visitor information (Genesys Multicloud CX)}}
 +
**{{Link-AnywhereElse|product=ATC|version=Current|manual=AgentGuide|topic=PureConnect|anchor=VisitorInfo|display text=Visitor information (PureConnect)}}
 +
|Status=No
 +
}}{{Section
 +
|sectionHeading=AI-381 Replace image in previous section
 +
|alignment=Horizontal
 +
|Media=Image
 +
|image=TraitsMapper.png
 +
|AltText=View mapped traits in user interface
 +
|Status=Yes
 +
}}{{Section
 +
|sectionHeading=Map traits globally
 +
|anchor=GlobalTraitsMapper
 +
|alignment=Vertical
 +
|structuredtext=To start mapping traits, define a global traits mapper when you deploy the {{MINTYDOCSPRODUCT}} tracking snippet on your website. Specifically, when you call {{Link-SomewhereInThisVersion|manual=SDK|topic=Init}} to initialize the Journey JavaScript SDK, identify which attributes to treat as traits. See the following code example.
  
{{NoteFormat|Separate customer records are not consolidated into a single customer record. Instead, all customer reords are updated with traits information.}}
+
For more information, see {{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper#TraitsTrackingMethods|display text = Methods that track events}} and {{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper#MappableTraits|display text = Mappable traits.}}
  
 +
When {{MINTYDOCSPRODUCT}} gathers values for these attributes, they map as traits.
  
Traits information appears on Live Now.
+
You can also {{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper#LocalTraitsMapper|display text=map traits based on specific events.}}
 +
===Example===
 +
<source lang="JavaScript">
 +
<script>
 +
  (function(a,t,c,l,o,u,d){a['_genesysJourneySdk']=o;a[o]=a[o]||function(){
 +
  (a[o].q=a[o].q||[]).push(arguments)},a[o].l=1*new Date();u=t.createElement(c),
 +
  d=t.getElementsByTagName(c)[0];u.async=1;u.src=l;u.charset='utf-8';d.parentNode.insertBefore(u,d)
 +
  })(window, document, 'script', 'https://apps.mypurecloud.com/journey/sdk/js/web/v1/ac.js', 'ac');
 +
  ac('init', 'c232166f-0136-4557-8dce-c88339d17a4e', {
 +
    region: 'use1',
 +
    globalTraitsMapper: [
 +
      {
 +
        "fieldName": "emailAddress",
 +
        "traitName": "email"
 +
      }
 +
    ]
 +
  });
 +
  ac('pageview');
 +
</script>
 +
</source>
 +
|Status=No
 +
}}{{Section
 +
|sectionHeading=AI-381 Replace example in previous section
 +
|alignment=Vertical
 +
|structuredtext====Example===
 +
<source lang="JavaScript">
 +
<script>
 +
  (function(a,t,c,l,o,u,d){a['_genesysJourneySdk']=o;a[o]=a[o]||function(){
 +
  (a[o].q=a[o].q||[]).push(arguments)},a[o].l=1*new Date();u=t.createElement(c),
 +
  d=t.getElementsByTagName(c)[0];u.async=1;u.src=l;u.charset='utf-8';d.parentNode.insertBefore(u,d)
 +
  })(window, document, 'script', 'https://apps.mypurecloud.com/journey/sdk/js/web/v1/ac.js', 'ac');
 +
  ac('init', 'c232166f-0136-4557-8dce-c88339d17a4e', {
 +
    region: 'use1',
 +
    globalTraitsMapper: [
 +
      {
 +
        "fieldName": "emailAddress",
 +
        "traitName": "email"
 +
      }, {
 +
        "fieldName": "company",
 +
        "traitName": "companyName"
 +
      }
 +
    ]
 +
  });
 +
  ac('pageview');
 +
</script>
 +
</source>
 +
|Status=Yes
 +
}}{{Section
 +
|sectionHeading=Map traits for a specific event
 +
|anchor=LocalTraitsMapper
 +
|alignment=Vertical
 +
|structuredtext=You can map specific traits locally instead of globally for specific events. For more information, see {{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper#TraitsTrackingMethods|display text = Methods that track events}} and {{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper#MappableTraits|display text = Mappable traits.}}
  
 +
The complete set of map traits for a customer is the union of globally and locally mapped traits. For example, suppose you map the email address field using the global traits mapper, but on one page you ask for the customer's phone number. Both the email address and the phone number map to the customer and both appear in the customer's Live Now profile.
  
The traits mapper updates customer records with new trait information. Existing or duplicate traits information is overwritten.
+
If {{MintyDocsProduct}} captures the same data in two places, the most recent trait mapped appears in Live Now. Previous values for mapped traits are not preserved.
|fullwidth=No
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
|sectionHeading=Traits that can link records
+
|sectionHeading=Examples of mapped traits
|Type=Structured
 
 
|alignment=Vertical
 
|alignment=Vertical
|gif=No
+
|structuredtext=The following examples show how to map attributes as traits. Specifically:
|structuredtext====Demographic traits===
+
 
 +
*The attributes, "email" and "emailAddress" map to the trait "email."
  
 +
<br />
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
 +
{{!}}+
 +
!<small>Attributes</small>
 +
!<small>traitsMapper</small>
 +
!<small>Traits</small>
 
{{!}}-
 
{{!}}-
{{!}}{{!}}'''Trait'''
+
{{!}}<small>{</small>
{{!}}{{!}}'''Example'''
+
 
 +
<small>    "email":  "firstname.lastname@somemail.com",</small>
 +
 
 +
<small>    "comment": "This is great",</small>
 +
 
 +
<small>    "section": "support"</small>
 +
 
 +
<small>}</small>
 +
{{!}}<small>[</small>
 +
<small>   {"fieldName": "email"},</small>
 +
 
 +
<small>]</small>
 +
{{!}}<small>{</small>
 +
 
 +
<small>    "email": firstname.lastname@somemail.com",</small>
 +
 
 +
<small>}</small>
 
{{!}}-
 
{{!}}-
{{!}}{{!}}gender
+
{{!}}<small>{</small>
{{!}}{{!}}male
+
<small>    "emailAddress":  "firstname.lastname@somemail.com",</small>
 +
 
 +
<small>    "comment": "This is great",</small>
 +
 
 +
<small>    "section": "support"</small>
  
 +
<small>}</small>
 +
{{!}}<small>[</small>
 +
<small>  {</small>
  
{{!}}-
+
<small>     "fieldName": "emailAddress",</small>
{{!}}{{!}}birthDate
+
 
{{!}}{{!}}01012001
+
<small>     "traitName": "email"</small>
{{!}}}
 
  
 +
<small>   }</small>
  
 +
<small>]</small>
 +
{{!}}<small>{</small>
  
 +
<small>    "email": firstname.lastname@somemail.com",</small>
  
 +
<small>}</small>
 +
{{!}}}
 +
<br />
 +
|Status=No
 +
}}{{Section
 +
|sectionHeading=AI-381 Replace previous section
 +
|alignment=Vertical
 +
|structuredtext=The following examples show how to map attributes as traits. Specifically:
  
===Company traits===
+
*The attributes, "email" and "emailAddress" map to the trait "email."
 +
*The attributes, "company" and "companyName" map to the trait "companyName."
  
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
 +
{{!}}+
 +
!<small>Attributes</small>
 +
!<small>traitsMapper</small>
 +
!<small>Traits</small>
 
{{!}}-
 
{{!}}-
{{!}}{{!}}'''Trait'''
+
{{!}}<small>{</small>
{{!}}{{!}}'''Example'''
+
<small>    "email":  "firstname.lastname@somemail.com",</small>
 +
 
 +
<small>    "companyName": "ABC corporation",</small>
 +
 
 +
<small>    "comment": "Here is a comment",</small>
 +
 
 +
<small>    "section": "support"</small>
 +
 
 +
<small>}</small>
 +
{{!}}<small>[</small>
 +
<small>   {"fieldName": "email"},</small>
 +
 
 +
<small>   {"fieldname": "companyName"}</small>
 +
 
 +
<small>]</small>
 +
{{!}}<small>{</small>
 +
<small>    "email": firstname.lastname@somemail.com",</small>
 +
 
 +
<small>    "companyName": "ABC corporation"</small>
 +
 
 +
<small>}</small>
 
{{!}}-
 
{{!}}-
{{!}}{{!}}companyName
+
{{!}}<small>{</small>
{{!}}{{!}}Genesys
+
<small>    "emailAddress":  "firstname.lastname@somemail.com",</small>
{{!}}-
+
 
{{!}}{{!}}[https://www.dnb.com/duns-number.html dunsNumber]
+
<small>    "company": "ABC corporation",</small>
{{!}}{{!}}622286318
+
 
{{!}}-
+
<small>    "comment": "Here is a comment",</small>
{{!}}{{!}}industry
+
 
{{!}}{{!}}Technology
+
<small>    "section": "support"</small>
{{!}}-
+
 
{{!}}{{!}}numberofEmployees
+
<small>}</small>
{{!}}{{!}}5025
+
{{!}}<small>[</small>
{{!}}}
+
<small>  {</small>
 +
 
 +
<small>     "fieldName": "emailAddress",</small>
 +
 
 +
<small>     "traitName": "email"</small>
  
 +
<small>   },  {</small>
  
 +
<small>      "fieldname": "company",</small>
  
 +
<small>      "traitName": "companyName"</small>
  
 +
<small>  }</small>
  
 +
<small>]</small>
 +
{{!}}<small>{</small>
 +
<small>    "email": firstname.lastname@somemail.com",</small>
  
 +
<small>    "companyName": "ABC corporation"</small>
  
===ID traits===
+
<small>}</small>
 +
{{!}}}
 +
|Status=Yes
 +
}}{{Section
 +
|sectionHeading=Methods that track events
 +
|anchor=TraitsTrackingMethods
 +
|alignment=Vertical
 +
|structuredtext=Traits mapping can occur whenever there is a tracked event on your website. Specifically, {{MintyDocsProduct}} tracks events when you use the following methods:
  
 +
*{{Link-SomewhereInThisVersion|manual=SDK|topic=Init}}
 +
*{{Link-SomewhereInThisVersion|manual=SDK|topic=Pageview}}
 +
*{{Link-SomewhereInThisVersion|manual=SDK|topic=Record}}
 +
*{{Link-SomewhereInThisVersion|manual=SDK|topic=Forms:track}}
 +
|Status=No
 +
}}{{Section
 +
|sectionHeading=Mappable traits
 +
|anchor=MappableTraits
 +
|alignment=Vertical
 +
|structuredtext====ID traits===
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
 
{{!}}-
 
{{!}}-
{{!}}{{!}}'''Trait'''
+
{{!}} style="width:20%"{{!}}'''Trait'''
 
{{!}}{{!}}'''Example'''
 
{{!}}{{!}}'''Example'''
 
{{!}}-
 
{{!}}-
 
{{!}}{{!}}email
 
{{!}}{{!}}email
 
{{!}}{{!}}JTS1715@gmail.com
 
{{!}}{{!}}JTS1715@gmail.com
{{!}}-
 
{{!}}{{!}}facebookId
 
{{!}}{{!}}JTSmith1715
 
{{!}}-
 
{{!}}{{!}}messengerId
 
{{!}}{{!}}John.Smith .1715
 
{{!}}-
 
{{!}}{{!}}twitterId
 
{{!}}{{!}}@JTS1715
 
{{!}}-
 
{{!}}{{!}}telegramId
 
{{!}}{{!}}123456789
 
 
{{!}}}
 
{{!}}}
 
 
 
 
 
 
===Phone traits===
 
===Phone traits===
 
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
 
{{!}}-
 
{{!}}-
{{!}}{{!}}'''Trait'''
+
{{!}} style="width:20%"{{!}}'''Trait'''
 
{{!}}{{!}}'''Example'''
 
{{!}}{{!}}'''Example'''
 
{{!}}-
 
{{!}}-
Line 115: Line 270:
 
{{!}}{{!}}3179871234
 
{{!}}{{!}}3179871234
 
{{!}}-
 
{{!}}-
{{!}}{{!}}mobilePhone
+
{{!}}{{!}}cellPhone
{{!}}{{!}} 
+
{{!}}{{!}}3179871235
 
{{!}}-
 
{{!}}-
{{!}}{{!}}workPhone
+
{{!}}{{!}}otherPhone
{{!}}{{!}}
+
{{!}}{{!}}3179712356
 
+
{{!}}-
 +
{{!}}workPhone
 +
{{!}}8179874321
 
{{!}}}
 
{{!}}}
Question: Country code? Area code?
 
 
===Name traits===
 
===Name traits===
 
 
{{{!}} class="wikitable"
 
{{{!}} class="wikitable"
 
{{!}}-
 
{{!}}-
{{!}}{{!}}'''Trait'''
+
{{!}} style="width:20%"{{!}}'''Trait'''
 
{{!}}{{!}}'''Example'''
 
{{!}}{{!}}'''Example'''
 
{{!}}-
 
{{!}}-
 
{{!}}{{!}}salutation
 
{{!}}{{!}}salutation
{{!}}{{!}}Question: Is this title?
+
{{!}}{{!}}Mr.
 
{{!}}-
 
{{!}}-
 
{{!}}{{!}}jobTitle
 
{{!}}{{!}}jobTitle
Line 144: Line 299:
 
{{!}}{{!}}familyName
 
{{!}}{{!}}familyName
 
{{!}}{{!}}Smith
 
{{!}}{{!}}Smith
{{!}}-
 
{{!}}{{!}}displayName
 
{{!}}{{!}}John
 
 
{{!}}}
 
{{!}}}
|fullwidth=No
 
|Status=No
 
}}{{Section
 
|sectionHeading=How to use the traits mapper
 
|Type=Structured
 
|anchor=UseTraitsMapper
 
|alignment=Vertical
 
|gif=No
 
|structuredtext=To link customer records using the trait mapper functionality:
 
# Deploy the
 
# Call ac.identify and specify a traits object.
 
# Call ac.record and extract the traits from its attributes.
 
 
Daragh:
 
# Where do they call ac.identify from? Is this part of the tracking snippet? If so, can you provide an example of a complete tracking snippet that calls ac.identify?
 
 
# Where do they call ac.record from?
 
 
# Where do the results go? Is this linkage a permanent change? If so, where are the results stored?
 
|fullwidth=No
 
 
|Status=No
 
|Status=No
 
}}
 
}}
 
}}
 
}}

Latest revision as of 10:17, March 8, 2024

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

Learn how to map multiple records for the same customer to see more complete customer profiles in Live Now.

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.

About traits mapping

Traits are properties, such as a customer's email address or phone number. Genesys Predictive Engagement gathers customer traits every time a customer visits a website that you track with the Genesys Predictive Engagement tracking snippet. It's possible to have multiple customer records for the same person. For example, when a customer visits your website multiple times and uses a different browser each time. Because Genesys Predictive Engagement creates a separate record for each instance, the separate customer records may contain only a subset of all the available customer traits. You can map the traits that the separate customer records contain to link the records. Then, you can see the complete customer information in Live Now.

Important
When the traits mapper links customer records, it preserves the separate customer records. It doesn't consolidate them into a single customer record. Instead, the traits mapper updates all linked customer records with the current traits information.

After linking customer records, the traits mapper updates all the records when new trait information becomes available. It overwrites existing or duplicate traits with the most current trait information.

View mapped traits in the user interface

After you map traits, they appear here:

AI-381 Replace image in previous section

View mapped traits in user interface

Map traits globally

To start mapping traits, define a global traits mapper when you deploy the Genesys Predictive Engagement tracking snippet on your website. Specifically, when you call init to initialize the Journey JavaScript SDK, identify which attributes to treat as traits. See the following code example.

For more information, see Methods that track events and Mappable traits.

When Genesys Predictive Engagement gathers values for these attributes, they map as traits.

You can also map traits based on specific events.

Example

<script>
  (function(a,t,c,l,o,u,d){a['_genesysJourneySdk']=o;a[o]=a[o]||function(){
  (a[o].q=a[o].q||[]).push(arguments)},a[o].l=1*new Date();u=t.createElement(c),
  d=t.getElementsByTagName(c)[0];u.async=1;u.src=l;u.charset='utf-8';d.parentNode.insertBefore(u,d)
  })(window, document, 'script', 'https://apps.mypurecloud.com/journey/sdk/js/web/v1/ac.js', 'ac');
  ac('init', 'c232166f-0136-4557-8dce-c88339d17a4e', {
    region: 'use1',
    globalTraitsMapper: [
      {
        "fieldName": "emailAddress",
        "traitName": "email"
      }
    ]
  });
  ac('pageview');
</script>

AI-381 Replace example in previous section

Example

<script>
  (function(a,t,c,l,o,u,d){a['_genesysJourneySdk']=o;a[o]=a[o]||function(){
  (a[o].q=a[o].q||[]).push(arguments)},a[o].l=1*new Date();u=t.createElement(c),
  d=t.getElementsByTagName(c)[0];u.async=1;u.src=l;u.charset='utf-8';d.parentNode.insertBefore(u,d)
  })(window, document, 'script', 'https://apps.mypurecloud.com/journey/sdk/js/web/v1/ac.js', 'ac');
  ac('init', 'c232166f-0136-4557-8dce-c88339d17a4e', {
    region: 'use1',
    globalTraitsMapper: [
      {
        "fieldName": "emailAddress",
        "traitName": "email"
      }, {
        "fieldName": "company",
        "traitName": "companyName"
      }
    ]
  });
  ac('pageview');
</script>

Map traits for a specific event

You can map specific traits locally instead of globally for specific events. For more information, see Methods that track events and Mappable traits.

The complete set of map traits for a customer is the union of globally and locally mapped traits. For example, suppose you map the email address field using the global traits mapper, but on one page you ask for the customer's phone number. Both the email address and the phone number map to the customer and both appear in the customer's Live Now profile.

If Genesys Predictive Engagement captures the same data in two places, the most recent trait mapped appears in Live Now. Previous values for mapped traits are not preserved.

Examples of mapped traits

The following examples show how to map attributes as traits. Specifically:

  • The attributes, "email" and "emailAddress" map to the trait "email."


Attributes traitsMapper Traits
{

    "email": "firstname.lastname@somemail.com",

    "comment": "This is great",

    "section": "support"

}

[

   {"fieldName": "email"},

]

{

    "email": firstname.lastname@somemail.com",

}

{

    "emailAddress": "firstname.lastname@somemail.com",

    "comment": "This is great",

    "section": "support"

}

[

{

    "fieldName": "emailAddress",

    "traitName": "email"

   }

]

{

    "email": firstname.lastname@somemail.com",

}


AI-381 Replace previous section

The following examples show how to map attributes as traits. Specifically:

  • The attributes, "email" and "emailAddress" map to the trait "email."
  • The attributes, "company" and "companyName" map to the trait "companyName."
Attributes traitsMapper Traits
{

    "email": "firstname.lastname@somemail.com",

    "companyName": "ABC corporation",

    "comment": "Here is a comment",

    "section": "support"

}

[

   {"fieldName": "email"},

   {"fieldname": "companyName"}

]

{

    "email": firstname.lastname@somemail.com",

    "companyName": "ABC corporation"

}

{

    "emailAddress": "firstname.lastname@somemail.com",

    "company": "ABC corporation",

    "comment": "Here is a comment",

    "section": "support"

}

[

{

    "fieldName": "emailAddress",

    "traitName": "email"

   }, {

      "fieldname": "company",

      "traitName": "companyName"

}

]

{

    "email": firstname.lastname@somemail.com",

    "companyName": "ABC corporation"

}

Methods that track events

Traits mapping can occur whenever there is a tracked event on your website. Specifically, Genesys Predictive Engagement tracks events when you use the following methods:

Mappable traits

ID traits

Trait Example
email JTS1715@gmail.com

Phone traits

Trait Example
homePhone 3179871234
cellPhone 3179871235
otherPhone 3179712356
workPhone 8179874321

Name traits

Trait Example
salutation Mr.
jobTitle Manager
givenName John
middleName Thomas
familyName Smith
Retrieved from "https://all.docs.genesys.com/ATC/Current/SDK/Traits_mapper (2024-10-06 21:03:12)"
Comments or questions about this documentation? Contact us for support!