Engagement Interactions

An engagement interaction occurs when a customer engages with your site through buttons, links, or other page elements.

Interaction NameDescription
anchor-clickCaptures any anchor click.
button-clickCaptures any button click.
page-scroll-to-bottomCaptures when a user scrolls to the bottom of the page.
page-viewCaptures the event when a user views a page.

Fields 

FieldTypeDetails
attributesobjectA dictionary of values that you supply.
linkhrefstringThe web address of the link to capture.
namestringRequired. The event name.

Anchor Click Interaction Event 

1event.target.dispatchEvent(
2    new CustomEvent('experience_interaction', {
3        bubbles: true,
4        composed: true,
5        detail: {
6            name: 'anchor-click',
7            linkHref: 'https://expectedUrl'
8            attributes: {
9                buttonLabel: 'Click here'
10            },
11        },
12    })
13);

Button Click Interaction Event 

1event.target.dispatchEvent(
2    new CustomEvent('experience_interaction', {
3        bubbles: true,
4        composed: true,
5        detail: {
6            name: 'button-click',
7            attributes: {
8                buttonLabel: 'Click here'
9            }
10        },
11    })
12);