Suma Analytics
E-commerce event tracking and analytics triggers for WordPress, BigCommerce, and WooCommerce.
Overview
Suma Analytics provides a unified analytics tracking system that fires standardized e-commerce events across different platforms (BigCommerce for WordPress, WooCommerce) and sends them to analytics services like Google Analytics 4 (GA4).
Current Version: 1.4.3
Requires: WordPress 4.7+, PHP 8.0+
Text Domain: suma-analytics
Key Features
Platform Support
E-commerce Source Platforms:
- BigCommerce for WordPress (full support)
- WooCommerce (partial support)
Analytics Target Platforms:
- Google Analytics 4 (GA4)
- Extensible architecture for additional platforms
Supported Events
The plugin tracks these standardized e-commerce events:
product/viewed— Product detail page viewedproduct/clicked— Product link clickedproduct/added-to-cart— Product added to shopping cartcart/viewed— Shopping cart page viewedcheckout/viewed— Checkout process initiatedcheckout/complete— Order completed successfully
Note: BigCommerce handles checkout/* events natively for GA4 targets.
GA4 Event Mapping
Standard GA4 events generated:
add_to_cartview_itemview_cartbegin_checkoutpurchase
How It Works
- Event Detection — Plugin hooks into WordPress/WooCommerce/BigCommerce page loads
- Data Collection — Extracts product, cart, or order data from the current context
- Event Configuration — Builds event payload with standardized structure
- Analytics Rendering — Outputs JavaScript tracking code to page footer
- GA4 Submission — Browser sends event data to Google Analytics
Architecture Overview
Frontend Request
↓
Platform Resolver (BC/WC detection)
↓
Event Type Resolver
↓
Data Collector
↓
Target Resolver (GA4)
↓
JavaScript Renderer
↓
Client-side Analytics
Use Cases
- Unified Analytics — Track events consistently across different e-commerce platforms
- GA4 Migration — Easy transition from Universal Analytics to GA4
- Custom Events — Extend with additional event types via filters
- Multi-Platform Stores — Single analytics solution for mixed platform environments
Technical Requirements
- WordPress 4.7 or higher
- PHP 8.0 or higher
- BigCommerce for WordPress plugin (for BC support)
- WooCommerce (for WC support)
- Google Analytics 4 property configured
Build System
The plugin uses Laravel Mix for asset compilation:
- JavaScript: Webpack bundling with source maps
- CSS: Sass compilation with autoprefixer
- npm Scripts:
npm run dev,npm run prod,npm run watch
Extensibility
Developers can extend the plugin using filters:
Add Custom Events
add_filter('suma/analytics/config', function($config_data) {
$config_data['events']['custom/event'] = [
'type' => 'custom_event',
'data' => [/* event data */]
];
return $config_data;
});
Add New Platform Support
New e-commerce source platforms and analytics target platforms can be added by:
- Adding a case to the appropriate resolver class
- Implementing data extraction logic
- Mapping to target analytics format