# input_changed The `input_changed` event logs an instance where an input value changes. ```javascript import {register} from '@shopify/web-pixels-extension'; register(({analytics}) => { analytics.subscribe('input_changed', (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, }); }); }); ``` ```javascript analytics.subscribe('input_changed', (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, }); }); ``` ## Properties ### PixelEventsInputChanged The `input_changed` event logs an instance where an input, textarea, or select element on the page has changed ### clientId value: `string` The client-side ID of the customer, provided by Shopify ### data value: `PixelEventsInputChangedData` - PixelEventsInputChanged: export interface PixelEventsInputChanged { /** * The client-side ID of the customer, provided by Shopify */ clientId?: string; data?: PixelEventsInputChangedData; /** * 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.Dom; } - PixelEventsInputChangedData: export interface PixelEventsInputChangedData { element?: InputElement; } ### id value: `string` The ID of the customer event ### name value: `string` The name of the customer event ### seq value: `number` The sequence index number of the event. ### timestamp value: `string` The timestamp of when the customer event occurred, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format ### type value: `EventType.Dom` - EventType: export enum EventType { AdvancedDom = 'advanced-dom', Custom = 'custom', Dom = 'dom', Meta = 'meta', Standard = 'standard', } ### PixelEventsInputChangedData ### element value: `InputElement` - InputElement: export interface InputElement { /** * The id attribute of an element */ id?: string | null; /** * The name attribute of an element */ name?: string | null; /** * A string representation of the tag of an element */ tagName?: string | null; /** * The type attribute of an element. Often relevant for an input or button * element. */ type?: string | null; /** * The value attribute of an element. Often relevant for an input element. */ value?: string | null; } ### InputElement An object that contains data about an input element type ### id value: `string | null` The id attribute of an element ### name value: `string | null` The name attribute of an element ### tagName value: `string | null` A string representation of the tag of an element ### type value: `string | null` The type attribute of an element. Often relevant for an input or button element. ### value value: `string | null` The value attribute of an element. Often relevant for an input element. ### EventType ### AdvancedDom value: `advanced-dom` ### Custom value: `custom` ### Dom value: `dom` ### Meta value: `meta` ### Standard value: `standard`