--- title: Analytics.CustomView description: Publishes a custom page view event to the `Analytics.Provider` component. The `type` prop must be preceded by `custom_`. api_version: 2025-05 api_name: hydrogen source_url: html: https://shopify.dev/docs/api/hydrogen/latest/components/analytics-customview md: https://shopify.dev/docs/api/hydrogen/latest/components/analytics-customview.md --- # Analytics.​Custom​Viewcomponent Publishes a custom page view event to the `Analytics.Provider` component. The `type` prop must be preceded by `custom_`. ## analytics​Custom​View([props](#props-propertydetail-props)​) ### Parameters * props CustomViewProps required ### CustomViewProps * customData ```ts OtherData ``` * data ```ts OtherData ``` * type ```ts `custom_${string}` ``` ```ts { type: typeof AnalyticsEvent.CUSTOM_EVENT; data?: OtherData; customData?: OtherData; } ``` ### OtherData ```ts OtherData ``` ### Examples * #### example ##### Description This is the default example ##### JavaScript ```js import {Analytics} from '@shopify/hydrogen'; export default function Promotion() { return (

Promotion page

); } ``` ##### TypeScript ```ts import {Analytics} from '@shopify/hydrogen'; export default function Promotion() { return (

Promotion page

); } ```