input_ blurredinterface
interface
The event logs an instance where an input on a page loses focus.
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
.Dom
Was this section helpful?
Accessing DOM Events
import {register} from '@shopify/web-pixels-extension';
register(({analytics}) => {
analytics.subscribe('input_blurred', (event) => {
// Example for accessing event data
const element = event.data.element;
const elementId = element.id;
const elementValue = element.value;
const payload = {
event_name: event.name,
event_data: {
id: elementId,
value: elementValue,
},
};
// Example for sending event to third party servers
fetch('https://example.com/pixel', {
method: 'POST',
body: JSON.stringify(payload),
keepalive: true,
});
});
});