advanced_ dom_ window_ resizedinterface
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 a customer resizes their browser window.
Shopify Plus
This event is limited on checkout to stores on the Shopify Plus plan.
Anchor to propertiesProperties
- Anchor to clientIdclientIdstring
The client-side ID of the customer, provided by Shopify
- Anchor to datadataPixelEventsAdvancedDomWindowResizedData
No additional data is provided by design. Use the event context to get the latest window size.
- 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 typetypeEventType.AdvancedDom
PixelEventsAdvancedDomWindowResizedData
No additional data is provided by design. Use the event context to get the latest window size.
export interface PixelEventsAdvancedDomWindowResizedData {}
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',
}
Was this section helpful?
Accessing Advanced DOM Events
App Pixel
import {register} from '@shopify/web-pixels-extension';
register(({analytics}) => {
analytics.subscribe('advanced_dom_window_resized', (event) => {
// Accessing event payload
const payload = {
event_name: event.name,
event_data: {
width: event.context.window.innerWidth,
height: event.context.window.innerHeight,
},
};
// E.g. sending event to third party servers
fetch('https://example.com/pixel', {
method: 'POST',
body: JSON.stringify(payload),
keepalive: true,
});
});
});
Examples
Accessing Advanced DOM Events
App Pixel
import {register} from '@shopify/web-pixels-extension'; register(({analytics}) => { analytics.subscribe('advanced_dom_window_resized', (event) => { // Accessing event payload const payload = { event_name: event.name, event_data: { width: event.context.window.innerWidth, height: event.context.window.innerHeight, }, }; // E.g. sending event to third party servers fetch('https://example.com/pixel', { method: 'POST', body: JSON.stringify(payload), keepalive: true, }); }); });