Analytics Settings
Commerce Connect provides platform-agnostic analytics event tracking that works with Google Analytics 4, Google Tag Manager, and other analytics providers.
Overview
Section titled “Overview”The Analytics settings tab controls:
- E-commerce event tracking - Fire standardized events to analytics providers
- Cookie consent banner - Show GDPR-compliant consent banners to visitors
Events fire to both window.dataLayer and window.wpecEvents for maximum compatibility with analytics tools.
Configuration
Section titled “Configuration”Navigate to WordPress® Admin > WPE Commerce > Settings > Analytics to configure analytics tracking.
Enable Tracking
Section titled “Enable Tracking”Toggle Enable tracking to ON to start firing e-commerce events.
When enabled, Commerce Connect fires events to:
window.dataLayer- Standard data layer for Google Tag Manager and GA4window.wpecEvents- Lightweight typed event bus for custom integrations
Important: Enabling tracking does NOT automatically send data to Google Analytics. You must configure GA4 or Google Tag Manager in your theme for events to be captured.
Cookie Consent Banner
Section titled “Cookie Consent Banner”Configure cookie consent banner settings to comply with GDPR and privacy regulations:
Consent Required
Section titled “Consent Required”Toggle ON if your store requires user consent before tracking analytics events (recommended for EU/EEA stores).
When enabled:
- No analytics events fire until user accepts cookies
- Consent state is captured in all events
- Users can change consent preferences later
Enable Cookie Consent Banner
Section titled “Enable Cookie Consent Banner”Toggle ON to display a built-in cookie consent banner to visitors.
When enabled:
- Banner appears to first-time visitors
- User can accept or decline tracking cookies
- Consent preference is stored in browser
Banner Position
Section titled “Banner Position”Choose where the consent banner appears on the page:
- Bottom (default) - Banner appears at bottom of viewport
- Top - Banner appears at top of viewport
How Analytics Work
Section titled “How Analytics Work”Commerce Connect uses a platform-agnostic architecture that works with any analytics provider:
- Plugin fires events - Commerce Connect sends standardized e-commerce events to
window.dataLayerandwindow.wpecEvents - Provider consumes events - Your analytics provider (GA4, GTM, Meta Pixel, Klaviyo, etc.) listens for and captures these events
- Theme activates provider - Your WordPress® theme is responsible for loading and configuring analytics scripts
Prerequisites
Section titled “Prerequisites”Analytics tracking requires:
- ✅ Enable tracking toggled ON in Analytics settings
- ✅ GA4 or GTM integration configured in your WordPress® theme
- ✅ Analytics script loaded on your site (gtag.js, GTM container, etc.)
Commerce Connect does NOT load analytics scripts directly - this keeps the plugin lean and provider-neutral.
Supported E-commerce Events
Section titled “Supported E-commerce Events”When tracking is enabled, Commerce Connect fires the following events:
Product Interaction Events
Section titled “Product Interaction Events”view_item- User views a product pageadd_to_cart- User adds product to cartremove_from_cart- User removes product from cartview_cart- User views their shopping cart
Checkout Events
Section titled “Checkout Events”purchase- Order completed successfully
Engagement Events
Section titled “Engagement Events”page_view- Page viewed (standard GA4 event)user_engagement- User actively engaging with sitescroll- User scrolled on page
Event Parameters
Section titled “Event Parameters”Each event includes rich data such as:
- Product price and SKU
- Page location and title
- Page referrer (navigation path)
- User consent state (GDPR compliance)
- Language and geographic data
- Measurement ID (GA4 property)
Event Schema Alignment
Section titled “Event Schema Alignment”Commerce Connect events follow BODL (BigCommerce Open Data Layer) schema alignment, ensuring:
- Consistent event naming across providers
- Standardized parameter structure
- Compatibility with BigCommerce analytics ecosystem
- Easy migration to/from BigCommerce analytics
Integration Patterns
Section titled “Integration Patterns”Google Analytics 4 (GA4)
Section titled “Google Analytics 4 (GA4)”Your theme activates GA4 integration by setting window.wpeCommerceGA4Config:
window.wpeCommerceGA4Config = { measurementId: 'G-XXXXXXXXXX',};Commerce Connect’s GA4 adapter then automatically sends events to your GA4 property.
Google Tag Manager (GTM)
Section titled “Google Tag Manager (GTM)”Events fired to window.dataLayer are automatically picked up by GTM. No special configuration needed - GTM listens for dataLayer.push() calls.
Other Analytics Providers
Section titled “Other Analytics Providers”Any provider can consume events from:
window.dataLayer(standard approach)window.wpecEvents(typed event bus)window.bodlEvents(via optional BODL bridge)
Testing Analytics
Section titled “Testing Analytics”To verify analytics tracking is working:
- Enable tracking in Analytics settings
- Open Chrome Tag Assistant (browser extension)
- Visit a product page and add to cart
- Check Tag Assistant panel for detected events and parameters
- Verify in GA4 Realtime report (if using GA4)
Expected results:
view_itemfires on product page loadadd_to_cartfires when adding product to cart- Event parameters include product price, URL, title
- GA4 Realtime dashboard shows events within seconds
Phase 2 Enhancements
Section titled “Phase 2 Enhancements”Future analytics improvements (not currently available):
- Native GA4 integration (no theme configuration required)
- Additional checkout funnel events (
begin_checkout,add_payment_info,add_shipping_info) - Enhanced conversion tracking
- Custom event configuration
See Phase 2 Features when available.
Troubleshooting
Section titled “Troubleshooting”Events not appearing in GA4
Section titled “Events not appearing in GA4”- Verify “Enable tracking” is ON in Analytics settings
- Check that GA4 or GTM is configured in your theme
- Confirm analytics script (gtag.js) is loading on the page
- Use Chrome Tag Assistant to verify events are firing
- Check browser console for JavaScript errors
Cookie consent banner not showing
Section titled “Cookie consent banner not showing”- Verify “Enable cookie consent banner” is ON
- Clear browser cookies and revisit site
- Check if user already accepted/declined (stored in browser)
- Verify banner position setting (Top or Bottom)
Consent not blocking tracking
Section titled “Consent not blocking tracking”- Verify “Consent required” is ON
- Clear cookies and test again
- Check browser console for consent state logs
Related Documentation
Section titled “Related Documentation”- Checkout Settings - Configure checkout experience
- Data Management - Admin functions and sync tools
- Phase 2 GA4 Integration Guide (coming soon)