Difference between revisions of "ATC/Current/SDK/Record"
DannaShirley (talk | contribs) (Published) |
|||
(17 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
|Standalone=No | |Standalone=No | ||
|DisplayName=record | |DisplayName=record | ||
− | |||
|TocName=record | |TocName=record | ||
+ | |Context=Learn how to use the <tt>record</tt> method to capture website events. | ||
+ | |Dimension=DevTracking | ||
|ComingSoon=No | |ComingSoon=No | ||
− | | | + | |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 | ||
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
|structuredtext=The <tt>record</tt> method records custom website events. | |structuredtext=The <tt>record</tt> method records custom website events. | ||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
|sectionHeading=Signature | |sectionHeading=Signature | ||
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
|structuredtext=<tt>ac('record', eventName, [customAttributes], [options])</tt> | |structuredtext=<tt>ac('record', eventName, [customAttributes], [options])</tt> | ||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
|sectionHeading=Arguments | |sectionHeading=Arguments | ||
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | + | |structuredtext=*[[#eventName|eventName]] | |
− | |structuredtext=* [[#eventName|eventName]] | + | *[[#customAttributes|customAttributes]] |
− | * [[#customAttributes|customAttributes]] | + | *[[#options|options]] |
− | * [[#options|options]] | ||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
|sectionHeading=eventName | |sectionHeading=eventName | ||
− | |||
|anchor=eventName | |anchor=eventName | ||
|alignment=Vertical | |alignment=Vertical | ||
− | + | |structuredtext=*'''Description:''' Name of the custom event | |
− | |structuredtext=* Description: | + | *'''Type:''' String |
− | * Type: | + | *'''Status:''' Required |
− | * Status: | + | *'''Restrictions''': See {{Link-SomewhereInThisVersion|manual=SDK|topic=Types_of_tracked_data|anchor=Guidelines|display text=Guidelines for custom event names}}. |
− | | | ||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
|sectionHeading=customAttributes | |sectionHeading=customAttributes | ||
− | |||
|anchor=customAttributes | |anchor=customAttributes | ||
|alignment=Vertical | |alignment=Vertical | ||
− | | | + | |structuredtext=*'''Description:''' Adds extra information to <code>pageview</code> event |
− | |structuredtext=* Description: | + | *'''Type:''' Object |
− | * Type: | + | *'''Status:''' Optional |
− | * Status: | + | *'''Restrictions:''' Flat object with properties of type string, number, Boolean, or customAttribute |
− | * Restrictions: | + | |
− | + | ====Example==== | |
+ | <code>ac('record', 'product_added', { price: 15.99, code: 'CDE-123', name: 'Product', hasBatteries: false });</code> | ||
+ | |||
+ | Additionally, define the datatype for the attribute to define the value better. | ||
+ | ====Example==== | ||
+ | <code>ac('record', 'product_added', { price: {datatype: 'integer' value: 15, name: {datatype: 'string' value: 'Product'}}}); </code> | ||
+ | |Status=No | ||
+ | }}{{Section | ||
+ | |sectionHeading=customAttributes for outcome value tracker | ||
+ | |anchor=outcome_value | ||
+ | |alignment=Vertical | ||
+ | |structuredtext=To derive the value of an outcome, create an event that comprises an associated value field. Then, using this event and the value field (within the same event), track the value of {{Link-SomewhereInThisVersion|manual=AdminGuide|topic=Manage_outcomes|display text=the outcome you created.}} | ||
+ | |||
+ | For example, the following event tracks the products added with the value, price''.'' When you create an outcome using this event, the products added along with their value is tracked as part of the outcome. | ||
+ | |||
+ | *'''Description:''' Adds extra information to <code>pageview</code> event | ||
+ | *'''Type:''' Object | ||
+ | *'''Status:''' Optional | ||
+ | *'''Restrictions:''' Flat object with properties of type string, number, or Boolean | ||
+ | |||
+ | ====Example==== | ||
+ | <code>ac('record', 'product_added', { price: 15, code: 'CDE-123', name: 'Product', hasBatteries: false });</code> | ||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
|sectionHeading=options | |sectionHeading=options | ||
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | + | |structuredtext=*'''Description:''' Used for more configuration | |
− | |structuredtext=* Description: Used for | + | *'''Type:''' Object |
− | * Type: | + | *'''Status:''' Optional |
− | * Status: | + | *'''Properties:''' See the following table. |
− | * Properties: | + | |
{{{!}} class="wikitable" | {{{!}} class="wikitable" | ||
{{!}}- | {{!}}- | ||
Line 73: | Line 86: | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}traitsMapper | {{!}}{{!}}traitsMapper | ||
− | {{!}}{{!}}Used to map custom attributes to traits. For more information, see{{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper|display text=Traits Mapper.}} | + | {{!}}{{!}}Used to map custom attributes to traits. For more information, see {{Link-SomewhereInThisVersion|manual=SDK|topic=Traits_mapper|display text=Traits Mapper.}} |
{{!}}{{!}}traitsMapper | {{!}}{{!}}traitsMapper | ||
{{!}}{{!}}<br /> | {{!}}{{!}}<br /> | ||
Line 79: | Line 92: | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}callback | {{!}}{{!}}callback | ||
− | {{!}}{{!}} | + | {{!}}{{!}}Called once beacon is sent |
{{!}}{{!}}function | {{!}}{{!}}function | ||
{{!}}{{!}}optional | {{!}}{{!}}optional | ||
Line 90: | Line 103: | ||
{{!}}{{!}}<br /> | {{!}}{{!}}<br /> | ||
{{!}}} | {{!}}} | ||
− | |||
|Status=No | |Status=No | ||
}} | }} | ||
}} | }} |
Latest revision as of 11:30, February 7, 2024
Contents
Learn how to use the record method to capture website events.
Description
The record method records custom website events.
Signature
ac('record', eventName, [customAttributes], [options])
Arguments
eventName
- Description: Name of the custom event
- Type: String
- Status: Required
- Restrictions: See Guidelines for custom event names.
customAttributes
- Description: Adds extra information to
pageview
event - Type: Object
- Status: Optional
- Restrictions: Flat object with properties of type string, number, Boolean, or customAttribute
Example
ac('record', 'product_added', { price: 15.99, code: 'CDE-123', name: 'Product', hasBatteries: false });
Additionally, define the datatype for the attribute to define the value better.
Example
ac('record', 'product_added', { price: {datatype: 'integer' value: 15, name: {datatype: 'string' value: 'Product'}}});
customAttributes for outcome value tracker
To derive the value of an outcome, create an event that comprises an associated value field. Then, using this event and the value field (within the same event), track the value of the outcome you created.
For example, the following event tracks the products added with the value, price. When you create an outcome using this event, the products added along with their value is tracked as part of the outcome.
- Description: Adds extra information to
pageview
event - Type: Object
- Status: Optional
- Restrictions: Flat object with properties of type string, number, or Boolean
Example
ac('record', 'product_added', { price: 15, code: 'CDE-123', name: 'Product', hasBatteries: false });
options
- Description: Used for more configuration
- Type: Object
- Status: Optional
- Properties: See the following table.
Name | Description | Type | Status | Default |
traitsMapper | Used to map custom attributes to traits. For more information, see Traits Mapper. | traitsMapper | ||
callback | Called once beacon is sent | function | optional | |
callbackTimeout | ms to wait for beacon to send | number | optional |