Install
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/eightam/openpanel-for-woocommerce/archive/refs/heads/main.zipPrivacy-friendly OpenPanel analytics for WordPress + WooCommerce. Ad-blocker resistant, self-hosted capable, with built-in WooCommerce event tracking.
Features
- 🚀 Ad-blocker resistant — op1.js is fetched, cached, and inlined locally; all analytics traffic goes through a REST proxy on your domain.
- 🛒 WooCommerce events (modern blocks AND classic):
purchase— server-side viawoocommerce_payment_complete/woocommerce_order_status_completed(covers offline gateways), deduplicated per order, with order items, revenue, currency, coupon, payment methodadd_to_cart— server-side viawoocommerce_add_to_cart(fires for classic AJAX and Store API blocks)view_item,view_item_list,search,begin_checkout— client-side on the relevant pages
- 🏠 Self-hosted support — configurable API URL and tracking script URL (settings or filters)
- 🔒 Privacy-friendly — cookie-less by default; optional visitor profile id stored in
localStorage(UUID) shared with the server for consistent server-side events - ⚡ Performance — async, non-blocking, fire-and-forget server events
Installation
- Download the ZIP and install via Plugins → Add New → Upload Plugin, or unzip into
wp-content/plugins/. - Activate OpenPanel for WooCommerce. (Requires WooCommerce.)
- Go to Settings → OpenPanel.
- Paste your Client ID and Client Secret (required for server-side event tracking).
- Self-hosted? Enter your API base URL (e.g.
https://analytics.example.com/api) and optionally your ownop1.jsURL. Leave empty for the hosted OpenPanel service. - Save. Done.
Event reference
| Event | When | How |
|---|---|---|
purchase |
order payment completes, or order status → completed (offline gateways) | server-side |
add_to_cart |
product added to cart (classic + blocks) | server-side |
view_item |
single product page | client-side |
view_item_list |
shop / product category / product tag | client-side |
search |
search results | client-side |
begin_checkout |
checkout page (once per session) | client-side |
Purchase properties
order_id, value, currency, payment_method, coupon, items[] (id, name, quantity, price).
Identity
- Logged-in shoppers → profileId = account email.
- Guests → profileId = a UUID stored in
localStorage/cookie (op_woo_visitor_id), so server-side events merge with the same browser's client-side profile. (Set a cookie before/at checkout and read it server-side if you need even earlier linkage.)
Filters
| Filter | Purpose |
|---|---|
openpanel_api_url |
Override the API base URL the proxy/events forward to |
openpanel_script_url |
Override the URL op1.js is loaded from |
openpanel_proxy_allowed_hosts |
Extend the hostname whitelist the proxy may forward to |
openpanel_woocommerce_purchase_properties |
Modify purchase event properties (properties, order) |
openpanel_woocommerce_cart_properties |
Modify add-to-cart event properties (properties, product, quantity) |
openpanel_woocommerce_profile_id |
Override the profile id used for an order (profile_id, order) |
openpanel_woocommerce_track_purchase |
Return false to skip tracking a specific order (bool, order) |
add_filter('openpanel_api_url', fn () => 'https://analytics.example.com/api');
add_filter('openpanel_woocommerce_purchase_properties', function ($props, $order) {
$props['customer_type'] = $order->get_user_id() ? 'registered' : 'guest';
return $props;
}, 10, 2);
Troubleshooting
Console shows POST /wp-json/openpanel-woocommerce/track 415 (Unsupported Media Type) — this was a bug in v1.0.0: the proxy stripped the Content-Type header before forwarding to the OpenPanel API (it only forwarded HTTP_* server headers; CONTENT_TYPE has no HTTP_ prefix). Fixed in v1.0.1. Upgrade, then hard-refresh (the script is cached).
Nothing appears in OpenPanel / wp? Make sure your Client ID (and Client Secret, for server-side events) are set in Settings → OpenPanel.
Avoiding blocklists — renaming the script
The tracking script is fetched, cached, and inlined into your page, so its external filename rarely matters. But some aggressive filter lists block the canonical op1.js name at the network level (when the inline cache is cold or the CDN fallback is used):
- Download
https://openpanel.dev/op1.jsto your server under a unique name, e.g.wp-content/uploads/analytics-7f3a.js. - In Settings → OpenPanel → Tracking script URL, enter
https://yourdomain.com/wp-content/uploads/analytics-7f3a.js. - Save and clear the script cache via the Clear Cache & Force Refresh button.
The script will now be fetched from your own domain under a name no filter list targets. (You can do the same via the openpanel_script_url filter.)
Auto-updates
This plugin self-updates from GitHub Releases using the bundled Plugin Update Checker library (MIT).
- Publishing an update: bump
Version:in the plugin header (andconst VERSION), commit, then tag:git tag v1.0.2 && git push origin v1.0.2. Optionally create a release for changelog notes. - On your site: WordPress will show the update under Plugins → Installed Plugins, and you can enable auto-updates per plugin.
⚠️ The version installed on your site and the tagged version must both derive from the same repo — if you've been installing from a standalone ZIP, update once manually by re-downloading (or use this repo's Releases) so the updater can track future versions.
Changelog
1.0.1
- 🐛 Fix
415 Unsupported Media Typeon the tracking proxy:Content-Type(andContent-MD5) are now preserved/forwarded; body-bearing requests default toapplication/jsonif still missing - 🛡️ Raise inline-script size limit (20KB → 64KB) so larger op1.js builds cache & inline correctly instead of falling back to the CDN
- 📖 Troubleshooting + "renaming the script" docs
1.0.0
- Initial release: self-hosted-capable proxy + WooCommerce event tracking
Disclaimer
Not affiliated with or endorsed by OpenPanel. The self-hosted architecture (settings + filters + dynamic proxy whitelist, version 1.0.0 skeleton) follows the approach of the official Openpanel-dev/wordpress-plugin PR, released under GPLv2.
License
GPLv2 or later — see LICENSE.
Releases
1 release.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.