advanced_ dom_ input_ focusedinterface
interface
Requires access to the Advanced DOM Events in web pixel app extensions scope. To request access, please use the form in the Partner Dashboard. 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 event is published when an input on a page gains focus.
Shopify Plus
This event is limited on checkout to stores on the Shopify Plus plan.
Anchor to propertiesProperties
Anchor to clientId
clientId
string
The client-side ID of the customer, provided by Shopify
Anchor to data
data
string
The ID of the customer event
Anchor to name
name
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
Anchor to type
type
.AdvancedDom
Was this section helpful?
Accessing Advanced DOM Events
App Pixel
import {register} from '@shopify/web-pixels-extension';
register(({analytics}) => {
analytics.subscribe('advanced_dom_input_focused', (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,
value: node.attributes?.value,
},
};
// E.g. sending event to third party servers
fetch('https://example.com/pixel', {
method: 'POST',
body: JSON.stringify(payload),
keepalive: true,
});
});
});