--- title: Analytics.CartView description: Publishes a `cart_viewed` event to the `Analytics.Provider` component. api_version: 2025-05 api_name: hydrogen source_url: html: https://shopify.dev/docs/api/hydrogen/latest/components/analytics/analytics-cartview md: https://shopify.dev/docs/api/hydrogen/latest/components/analytics/analytics-cartview.md --- # Analytics.CartViewcomponent Publishes a `cart_viewed` event to the `Analytics.Provider` component. ## analyticsCartView([props](#props-propertydetail-props)) ### Parameters * props BasicViewProps required ### BasicViewProps * customData ```ts OtherData ``` * data ```ts OtherData ``` ```ts { 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 CartView() { return (