Skip to main content

alert_displayed
interface

The alert_displayed event records instances when a user encounters an alert message, whether it's an inline validation message on an input field or a warning banner.

Note

This event is only available on checkout.

string

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

string

The ID of the customer event

string

The name of the customer event

number

The sequence index number of the event.

string

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

.Standard
Was this section helpful?

Accessing Standard Events

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

register(({analytics}) => {
analytics.subscribe('alert_displayed', (event) => {
// Example for accessing event data
const {target, type, message} = event.data.alert;

const payload = {
event_name: event.name,
event_data: {
target,
type,
message,
},
};

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