--- title: analytics description: Provides access to Shopify's [customer event API](/docs/api/web-pixels-api/standard-events) api_name: web-pixels source_url: html: https://shopify.dev/docs/api/web-pixels-api/standard-api/analytics md: https://shopify.dev/docs/api/web-pixels-api/standard-api/analytics.md --- # analyticsinterface Provides access to Shopify's [customer event API](https://shopify.dev/docs/api/web-pixels-api/standard-events) ## Properties * subscribe (eventName: string, event\_callback: Function) => Promise\ ### Examples * #### Accessing Standard Api ##### App Pixel ```javascript import {register} from '@shopify/web-pixels-extension'; register(({analytics, browser, settings, init}) => { analytics.subscribe('page_viewed', (event) => { // subscribe to page_viewed events }); analytics.subscribe('all_events', (event) => { // subscribe to all events }); analytics.subscribe('all_standard_events', (event) => { // subscribe to all standard events }); analytics.subscribe('all_custom_events', (event) => { // subscribe to all custom events }); }); ``` ##### Custom Pixel ```javascript analytics.subscribe('page_viewed', (event) => { // subscribe to page_viewed events }); analytics.subscribe('all_events', (event) => { // subscribe to all events }); analytics.subscribe('all_standard_events', (event) => { // subscribe to all standard events }); analytics.subscribe('all_custom_events', (event) => { // subscribe to all custom events }); ```