Difference between revisions of "ATC/Current/SDK/autotrackInViewport"
From Genesys Documentation
(Published) |
(Published) |
||
Line 43: | Line 43: | ||
|anchor=Config | |anchor=Config | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |structuredtext='''Description:''' | + | |structuredtext='''Description:''' Identifies an array of elements to track. |
− | '''Type:''' | + | '''Type:''' Object |
'''Properties:''' See the following table. | '''Properties:''' See the following table. |
Revision as of 18:00, December 16, 2020
This topic is part of the manual Journey JavaScript SDK for version Current of Genesys Predictive Engagement.
Learn how to configure which element Genesys Predictive Engagement tracks on your web sites as they appear and disappear from the viewport. This configuration provides accurate page tracking information for use in segments and outcomes.
Description
The autotrackInViewport
module tracks when an element becomes visible in the viewport or disappears from the viewport. To use autotrackInViewport
, configure the elements to track using the following options:
Signature
ac('load', 'autotrackInViewport', config, [callback]);
Example
ac('load', 'autotrackInViewport', {
inViewportEvents: [
{ selector: 'button.bg-green', eventName: 'green_button_element' },
{ selector: 'footer *', eventName: 'footer_element' }
]
}, function () {
console.log('"autotrackInViewport" has been loaded');
});
Config (required)
Description: Identifies an array of elements to track.
Type: Object
Properties: See the following table.
Name | Description | Type | Status |
---|---|---|---|
selector | String that selects elements. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches | String | required |
eventName | String used as the event name when an element matching the selector moves into or outside the viewport. | String | required |
Example
{
inViewportEvents: [
{ selector: 'button.bg-green', eventName: 'green_button_element' },
{ selector: 'footer', eventName: 'footer_element' }
]
}
Callback
When a module loads, callback is executed. No arguments pass to the callback.
Comments or questions about this documentation? Contact us for support!