Engagement Interactions

An engagement interaction occurs when a customer engages with your site through buttons, links, or other page elements.
Interaction Name Description
anchor-click Captures any anchor click.
button-click Captures any button click.
page-scroll-to-bottom Captures when a user scrolls to the bottom of the page.
page-view Captures the event when a user views a page.

Fields

Field Type Details
attributes object A dictionary of values that you supply.
linkhref string The web address of the link to capture.
name string Required. 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);