Cache-Safe Event Tracking (Beta)

Alpha Insights includes an opt-in beta tracking module designed for full-page cache compatibility. Enable it under Alpha Insights → Settings → General Settings → Alpha Analytics & Event Tracking → Cache-Safe Event Tracking (Beta).

How it works

Cookie storage modes

Cache plugin notes

When using checkout_only mode, Alpha Insights registers compatibility hooks for WP Rocket and LiteSpeed Cache to avoid treating wpd_ai_* cookies as cache-busting vary cookies. Configure Cloudflare or other CDNs to cache anonymous HTML separately from cart/checkout if needed.

Server-side events

In checkout_only mode, analytics cookies are written before add-to-cart requests and on cart/checkout pages. Session attribution is also loaded from the database when a matching session_id is available, so server-side hooks (add to cart, order completion) stay linked to the same visitor session.

Developer filters

Sunset path

To promote v2: enable by default, then remove the legacy tracking module. To abandon v2: delete includes/analytics-v2/ and assets/js/analytics-v2/, remove the beta setting, and remove the legacy constructor guard.