Skip to content

Analytics Settings

Commerce Connect provides platform-agnostic analytics event tracking that works with Google Analytics 4, Google Tag Manager, and other analytics providers.

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.

Navigate to WordPress® Admin > WPE Commerce > Settings > Analytics to configure analytics 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 GA4
  • window.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.

Configure cookie consent banner settings to comply with GDPR and privacy regulations:

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

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

Choose where the consent banner appears on the page:

  • Bottom (default) - Banner appears at bottom of viewport
  • Top - Banner appears at top of viewport

Commerce Connect uses a platform-agnostic architecture that works with any analytics provider:

  1. Plugin fires events - Commerce Connect sends standardized e-commerce events to window.dataLayer and window.wpecEvents
  2. Provider consumes events - Your analytics provider (GA4, GTM, Meta Pixel, Klaviyo, etc.) listens for and captures these events
  3. Theme activates provider - Your WordPress® theme is responsible for loading and configuring analytics scripts

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.

When tracking is enabled, Commerce Connect fires the following events:

  • view_item - User views a product page
  • add_to_cart - User adds product to cart
  • remove_from_cart - User removes product from cart
  • view_cart - User views their shopping cart
  • purchase - Order completed successfully
  • page_view - Page viewed (standard GA4 event)
  • user_engagement - User actively engaging with site
  • scroll - User scrolled on page

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)

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

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.

Events fired to window.dataLayer are automatically picked up by GTM. No special configuration needed - GTM listens for dataLayer.push() calls.

Any provider can consume events from:

  • window.dataLayer (standard approach)
  • window.wpecEvents (typed event bus)
  • window.bodlEvents (via optional BODL bridge)

To verify analytics tracking is working:

  1. Enable tracking in Analytics settings
  2. Open Chrome Tag Assistant (browser extension)
  3. Visit a product page and add to cart
  4. Check Tag Assistant panel for detected events and parameters
  5. Verify in GA4 Realtime report (if using GA4)

Expected results:

  • view_item fires on product page load
  • add_to_cart fires when adding product to cart
  • Event parameters include product price, URL, title
  • GA4 Realtime dashboard shows events within seconds

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.

  1. Verify “Enable tracking” is ON in Analytics settings
  2. Check that GA4 or GTM is configured in your theme
  3. Confirm analytics script (gtag.js) is loading on the page
  4. Use Chrome Tag Assistant to verify events are firing
  5. Check browser console for JavaScript errors
  1. Verify “Enable cookie consent banner” is ON
  2. Clear browser cookies and revisit site
  3. Check if user already accepted/declined (stored in browser)
  4. Verify banner position setting (Top or Bottom)
  1. Verify “Consent required” is ON
  2. Clear cookies and test again
  3. Check browser console for consent state logs