alert_ displayedinterface
The 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.
This event is only available on checkout.
Anchor to propertiesProperties
- Anchor to clientIdclientIdstring
The client-side ID of the customer, provided by Shopify
- Anchor to contextcontext
- Anchor to datadata
- string
The ID of the customer event
- Anchor to namenamestring
The name of the customer event
- number
The sequence index number of the event.
- Anchor to timestamptimestampstring
The timestamp of when the customer event occurred, in ISO 8601 format
- Anchor to typetype.Standard
PixelEventsAlertDisplayed
The `alert_displayed` event logs an instance of an alert being displayed to a buyer.
- clientId
The client-side ID of the customer, provided by Shopify
string
- context
Context
- data
PixelEventsAlertDisplayedData
- id
The ID of the customer event
string
- name
The name of the customer event
string
- seq
The sequence index number of the event.
number
- timestamp
The timestamp of when the customer event occurred, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format
string
- type
EventType.Standard
export interface PixelEventsAlertDisplayed {
/**
* The client-side ID of the customer, provided by Shopify
*/
clientId?: string;
context?: Context;
data?: PixelEventsAlertDisplayedData;
/**
* The ID of the customer event
*/
id?: string;
/**
* The name of the customer event
*/
name?: string;
/**
* The sequence index number of the event.
*/
seq?: number;
/**
* The timestamp of when the customer event occurred, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format
*/
timestamp?: string;
type?: EventType.Standard;
}
Context
A snapshot of various read-only properties of the browser at the time of event
- document
Snapshot of a subset of properties of the `document` object in the top frame of the browser
WebPixelsDocument
- navigator
Snapshot of a subset of properties of the `navigator` object in the top frame of the browser
WebPixelsNavigator
- window
Snapshot of a subset of properties of the `window` object in the top frame of the browser
WebPixelsWindow
export interface Context {
/**
* Snapshot of a subset of properties of the `document` object in the top
* frame of the browser
*/
document?: WebPixelsDocument;
/**
* Snapshot of a subset of properties of the `navigator` object in the top
* frame of the browser
*/
navigator?: WebPixelsNavigator;
/**
* Snapshot of a subset of properties of the `window` object in the top frame
* of the browser
*/
window?: WebPixelsWindow;
}
WebPixelsDocument
A snapshot of a subset of properties of the `document` object in the top frame of the browser
- characterSet
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document), returns the character set being used by the document
string
- location
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document), returns the URI of the current document
Location
- referrer
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document), returns the URI of the page that linked to this page
string
- title
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document), returns the title of the current document
string
export interface WebPixelsDocument {
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document),
* returns the character set being used by the document
*/
characterSet?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document),
* returns the URI of the current document
*/
location?: Location;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document),
* returns the URI of the page that linked to this page
*/
referrer?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document),
* returns the title of the current document
*/
title?: string;
}
Location
A snapshot of a subset of properties of the `location` object in the top frame of the browser
- hash
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing a `'#'` followed by the fragment identifier of the URL
string
- host
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing the host, that is the hostname, a `':'`, and the port of the URL
string
- hostname
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing the domain of the URL
string
- href
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing the entire URL
string
- origin
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing the canonical form of the origin of the specific location
string
- pathname
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing an initial `'/'` followed by the path of the URL, not including the query string or fragment
string
- port
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing the port number of the URL
string
- protocol
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing the protocol scheme of the URL, including the final `':'`
string
- search
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a string containing a `'?'` followed by the parameters or "querystring" of the URL
string
export interface Location {
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing a `'#'` followed by the fragment identifier of the URL
*/
hash?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing the host, that is the hostname, a `':'`, and the port of
* the URL
*/
host?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing the domain of the URL
*/
hostname?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing the entire URL
*/
href?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing the canonical form of the origin of the specific location
*/
origin?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing an initial `'/'` followed by the path of the URL, not
* including the query string or fragment
*/
pathname?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing the port number of the URL
*/
port?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing the protocol scheme of the URL, including the final `':'`
*/
protocol?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a
* string containing a `'?'` followed by the parameters or "querystring" of
* the URL
*/
search?: string;
}
WebPixelsNavigator
A snapshot of a subset of properties of the `navigator` object in the top frame of the browser
- cookieEnabled
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator), returns `false` if setting a cookie will be ignored and true otherwise
boolean
- language
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator), returns a string representing the preferred language of the user, usually the language of the browser UI. The `null` value is returned when this is unknown
string
- languages
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator), returns an array of strings representing the languages known to the user, by order of preference
ReadonlyArray<string>
- userAgent
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator), returns the user agent string for the current browser
string
export interface WebPixelsNavigator {
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator),
* returns `false` if setting a cookie will be ignored and true otherwise
*/
cookieEnabled?: boolean;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator),
* returns a string representing the preferred language of the user, usually
* the language of the browser UI. The `null` value is returned when this
* is unknown
*/
language?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator),
* returns an array of strings representing the languages known to the user,
* by order of preference
*/
languages?: ReadonlyArray<string>;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator),
* returns the user agent string for the current browser
*/
userAgent?: string;
}
WebPixelsWindow
A snapshot of a subset of properties of the `window` object in the top frame of the browser
- innerHeight
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar
number
- innerWidth
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), gets the width of the content area of the browser window including, if rendered, the vertical scrollbar
number
- location
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the location, or current URL, of the window object
Location
- origin
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the global object's origin, serialized as a string
string
- outerHeight
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), gets the height of the outside of the browser window
number
- outerWidth
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), gets the width of the outside of the browser window
number
- pageXOffset
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), an alias for window.scrollX
number
- pageYOffset
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), an alias for window.scrollY
number
- screen
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen), the interface representing a screen, usually the one on which the current window is being rendered
Screen
- screenX
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the horizontal distance from the left border of the user's browser viewport to the left side of the screen
number
- screenY
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the vertical distance from the top border of the user's browser viewport to the top side of the screen
number
- scrollX
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the number of pixels that the document has already been scrolled horizontally
number
- scrollY
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the number of pixels that the document has already been scrolled vertically
number
export interface WebPixelsWindow {
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window),
* gets the height of the content area of the browser window including, if
* rendered, the horizontal scrollbar
*/
innerHeight?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), gets
* the width of the content area of the browser window including, if rendered,
* the vertical scrollbar
*/
innerWidth?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the
* location, or current URL, of the window object
*/
location?: Location;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the
* global object's origin, serialized as a string
*/
origin?: string;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), gets
* the height of the outside of the browser window
*/
outerHeight?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), gets
* the width of the outside of the browser window
*/
outerWidth?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), an
* alias for window.scrollX
*/
pageXOffset?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), an
* alias for window.scrollY
*/
pageYOffset?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen), the
* interface representing a screen, usually the one on which the current
* window is being rendered
*/
screen?: Screen;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the
* horizontal distance from the left border of the user's browser viewport to
* the left side of the screen
*/
screenX?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the
* vertical distance from the top border of the user's browser viewport to the
* top side of the screen
*/
screenY?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the
* number of pixels that the document has already been scrolled horizontally
*/
scrollX?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the
* number of pixels that the document has already been scrolled vertically
*/
scrollY?: number;
}
Screen
The interface representing a screen, usually the one on which the current window is being rendered
- height
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen/height), the height of the screen
number
- width
Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen/width), the width of the screen
number
export interface Screen {
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen/height),
* the height of the screen
*/
height?: number;
/**
* Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen/width),
* the width of the screen
*/
width?: number;
}
PixelEventsAlertDisplayedData
- alert
AlertDisplayed
export interface PixelEventsAlertDisplayedData {
alert?: AlertDisplayed;
}
AlertDisplayed
An object that contains information about an alert that was displayed to a buyer.
- message
The message that was displayed to the user.
string
- target
The part of the page the alert relates to. Follows the [Shopify Functions target format](https://shopify.dev/docs/api/functions/reference/cart-checkout-validation/graphql#supported-checkout-field-targets), for example `cart.deliveryGroups[0].deliveryAddress.address1`.
string
- type
The type of alert that was displayed.
AlertDisplayedType
- value
The value of the field at the time the alert was displayed or null if the alert did not relate to an individual field.
string | null
export interface AlertDisplayed {
/**
* The message that was displayed to the user.
*/
message?: string;
/**
* The part of the page the alert relates to.
* Follows the [Shopify Functions target
* format](https://shopify.dev/docs/api/functions/reference/cart-checkout-validation/graphql#supported-checkout-field-targets), for example
* `cart.deliveryGroups[0].deliveryAddress.address1`.
*/
target?: string;
/**
* The type of alert that was displayed.
*/
type?: AlertDisplayedType;
/**
* The value of the field at the time the alert was displayed or null if the
* alert did not relate to an individual field.
*/
value?: string | null;
}
AlertDisplayedType
- CheckoutError
CHECKOUT_ERROR
- ContactError
CONTACT_ERROR
- DeliveryError
DELIVERY_ERROR
- DiscountError
DISCOUNT_ERROR
- InputInvalid
INPUT_INVALID
- InputRequired
INPUT_REQUIRED
- InventoryError
INVENTORY_ERROR
- MerchandiseError
MERCHANDISE_ERROR
- PaymentError
PAYMENT_ERROR
export enum AlertDisplayedType {
/**
* An alert related to general checkout issue was displayed.
*/
CheckoutError = 'CHECKOUT_ERROR',
/**
* An alert related to a contact information issue was displayed.
*/
ContactError = 'CONTACT_ERROR',
/**
* An alert related to a delivery issue was displayed.
*/
DeliveryError = 'DELIVERY_ERROR',
/**
* An alert related to a discount code or gift card issue was displayed.
*/
DiscountError = 'DISCOUNT_ERROR',
/**
* The input provided is incorrect or improperly formatted.
*/
InputInvalid = 'INPUT_INVALID',
/**
* A required field is empty.
*/
InputRequired = 'INPUT_REQUIRED',
/**
* An alert related to an inventory issue was displayed.
*/
InventoryError = 'INVENTORY_ERROR',
/**
* An alert related to a merchandise issue was displayed.
*/
MerchandiseError = 'MERCHANDISE_ERROR',
/**
* An alert related to a payment issue was displayed.
*/
PaymentError = 'PAYMENT_ERROR',
}
EventType
- AdvancedDom
advanced-dom
- Custom
custom
- Dom
dom
- Meta
meta
- Standard
standard
export enum EventType {
AdvancedDom = 'advanced-dom',
Custom = 'custom',
Dom = 'dom',
Meta = 'meta',
Standard = 'standard',
}
Accessing Standard Events
examples
Accessing Standard Events
App Pixel
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, }); }); });
Custom Pixel
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 to third party servers fetch('https://example.com/pixel', { method: 'POST', body: JSON.stringify(payload), keepalive: true, }); });