Skip to main content

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 viewed
  • product/clicked — Product link clicked
  • product/added-to-cart — Product added to shopping cart
  • cart/viewed — Shopping cart page viewed
  • checkout/viewed — Checkout process initiated
  • checkout/complete — Order completed successfully

Note: BigCommerce handles checkout/* events natively for GA4 targets.

GA4 Event Mapping

Standard GA4 events generated:

  • add_to_cart
  • view_item
  • view_cart
  • begin_checkout
  • purchase

How It Works

  1. Event Detection — Plugin hooks into WordPress/WooCommerce/BigCommerce page loads
  2. Data Collection — Extracts product, cart, or order data from the current context
  3. Event Configuration — Builds event payload with standardized structure
  4. Analytics Rendering — Outputs JavaScript tracking code to page footer
  5. 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:

  1. Adding a case to the appropriate resolver class
  2. Implementing data extraction logic
  3. Mapping to target analytics format