Analytics
Handles the registration and configuration of analytics services and events for BigCommerce.
This class provides integration for popular analytics platforms like Facebook Pixel, Google Analytics, and Segment. It also manages the registration of event tracking for actions such as adding to cart and viewing products.
- Full name:
\BigCommerce\Container\Analytics
- Parent class:
Provider
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
FACEBOOK_PIXEL | public | string | ’analytics.facebook’ |
GOOGLE_ANALYTICS | public | string | ’analytics.google’ |
SEGMENT | public | string | ’analytics.segment’ |
ADD_TO_CART | public | string | ’analytics.events.add_to_cart’ |
VIEW_PRODUCT | public | string | ’analytics.events.view_product’ |
Methods
register
Registers analytics services and events into the container
public register(\Pimple\Container $container): void
This function registers all necessary analytics providers (Facebook Pixel, Google Analytics, Segment) and event listeners for tracking various interactions such as add-to-cart and product views.
Parameters:
Parameter | Type | Description |
---|---|---|
$container | \Pimple\Container | The dependency injection container. |
Automatically generated on 2025-01-21