autoTrackClick

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Journey JavaScript SDK for version Current of Altocloud.

Learn how to configure which click events Altocloud tracks on your websites, so you have more accurate page tracking information for use in segments and outcomes.

Description

The autoTrackClick module tracks when and where a user clicks on a webpage. To use autoTrackClick, use the following options to configure the click events that you want to track:

Signature

ac('load', 'autotrackClick', config, [callback]);

Example

ac('load', 'autotrackClick', {
  clickEvents: [
    { selector: 'button.bg-green', eventName: 'green_button_clicked' },
    { selector: 'footer *', eventName: 'footer_clicked' }
  ]
}, function () {
    console.log('"autotrackClick" has been loaded');
});

Config (required)

Description: identifies an array of click events that should be tracked.

Type: object

Returns: Nothing

Properties:

Name Description Type Status
selector A string that selects elements. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches String required
eventName is a string that will be used as the event name when an element matching the selector is clicked. String required

Example

{
  clickEvents: [
    { selector: 'button.bg-green', eventName: 'green_button_clicked' },
    { selector: 'footer *', eventName: 'footer_clicked' }
  ]
}

Callback (optional)

When a module fully loads, callback is executed. By default, it returns nothing to you. However, you can override the default callback behavior if, for example, you want to supply your own callback behavior and wait for it to execute before doing some other function on your website.

Retrieved from "https://all.docs.genesys.com/ATC/Current/SDK/autoTrackClick (2020-08-08 06:16:10)"