WP Manifestindependent plugin directory
manifest / analytics / wc-order-source-tracker

CM Order Source Tracker

Free WooCommerce plugin: captures UTM parameters, referrer, and landing page from the visitor session and attaches first-click and last-click attribution data to orders.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/harperagency/wc-order-source-tracker/archive/refs/heads/trunk.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

CM Order Source Tracker for WooCommerce

Captures UTM parameters, referrer, and landing page from the visitor session and attaches first-click and last-click attribution data to WooCommerce orders.

Features

  • Captures all 5 UTM parameters plus referrer, landing page, and GA4 client ID
  • Stores two attribution models per order: first click (set once) and last click (updated on every UTM visit)
  • Source type classification: paid_search, paid_social, email, social, organic, referral, direct
  • Source column in the orders list (HPOS + legacy post-based)
  • UTM detail panel in the order admin view
  • No external requests, no JavaScript, no third-party dependencies
  • Full HPOS (High-Performance Order Storage) compatibility
  • Clean uninstall - removes all order meta on plugin deletion

Order Meta

Key Model When set
_cm_ost_first First click Set once on first visit with UTMs or referrer
_cm_ost_last Last click Updated on every visit with UTMs

Payload shape:

{
  "utm_source": "google",
  "utm_medium": "cpc",
  "utm_campaign": "black-friday",
  "utm_content": "banner-a",
  "utm_term": "woocommerce plugins",
  "referrer": "https://google.com/",
  "landing_page": "https://example.com/products/widget/",
  "source_type": "paid_search",
  "ga_client_id": "123456789.1728000000"
}

Requirements

  • PHP 8.1+
  • WordPress 6.0+
  • WooCommerce 7.0+

Installation

composer require claritymomentum/cm-order-source-tracker

Or download and drop into /wp-content/plugins/.

Development

composer install
composer test      # PHPUnit - 52 tests
composer phpcs     # PHPCS with WordPress coding standards

Architecture

includes/
├── Tracker/
│   ├── UtmExtractor.php      # Pure: extract + sanitize UTM params
│   ├── SourceClassifier.php  # Pure: classify source type, generate label
│   ├── CookieStore.php       # Read/write first+last click cookies
│   └── OrderCapture.php      # WP hooks: capture on init, save to order
└── Admin/
    ├── OrderSourceColumn.php  # Orders list column (HPOS + legacy)
    └── OrderSourceMetaBox.php # UTM detail panel in order view
  • SignalStream - Server-side GA4 and Meta CAPI relay for WooCommerce. Bypass iOS privacy restrictions and ad blockers with server-side event delivery.
  • Moneris WooCommerce Gateway - Moneris Checkout and HPP payment gateway with WooCommerce Subscriptions support.
  • Amazon Shipping for WooCommerce - Live Amazon Shipping rates and label printing in WooCommerce.

License

GPL-2.0-or-later. See LICENSE.

Built by Clarity Momentum.