Skip to main content

advanced_dom_clicked

Requires access to the Advanced DOM Events in web pixel app extensions scope. In the Dev Dashboard, go to Apps, open your app, click Settings, and then go to Access requests. Click Request access next to Advanced DOM Events (web pixels). If your app is already published on the Shopify App Store, then request access on a staging app. This scope is only available for apps that have a heatmap and/or session recordings. The Advanced DOM Events cannot be used on custom apps.

The advanced_dom_clicked event is published when a customer clicks on a page element.

Shopify Plus

This event is limited on checkout to stores on the Shopify Plus plan.

Anchor to clientId
clientId
string

The client-side ID of the customer, provided by Shopify

An object that contains data about a mouse event.

string

The ID of the customer event

string

The name of the customer event

number

The sequence index number of the event.

Anchor to timestamp
timestamp
string

The timestamp of when the customer event occurred, in ISO 8601 format

'advanced-dom'
Examples

App Pixel

import {register} from '@shopify/web-pixels-extension';

register(({analytics}) => {
analytics.subscribe('advanced_dom_clicked', (event) => {
// Accessing event payload
const node = event.data.node;

if (node?.nodeType !== Node.ELEMENT_NODE) return;

const payload = {
event_name: event.name,
event_data: {
id: node.serializationId,
url: node.attributes?.href,
},
};

// E.g. sending event to third party servers
fetch('https://example.com/pixel', {
method: 'POST',
body: JSON.stringify(payload),
keepalive: true,
});
});
});

Was this page helpful?