Skip to content

Data & Storage

CartBay stores recovery sessions as WooCommerce orders. There are no custom recovery-session database tables in v1.

A CartBay session is a WooCommerce order with:

  • created_via set to cartbay.
  • Billing email set to the captured checkout email.
  • A CartBay lifecycle status.
  • CartBay metadata prefixed with _cartbay_.
StatusMeaning
wc-cartbay-capturedShopper consented and the cart was captured.
wc-cartbay-abandonedCaptured session exceeded the inactivity timeout.
wc-cartbay-recoveredA later order matched the abandoned session.
wc-cartbay-suppressedShopper unsubscribed or was suppressed.

Free session meta keys:

Meta keyPurpose
_cartbay_session_idCartBay session identity.
_cartbay_emailCaptured email. Use carefully; this is PII.
_cartbay_consent, _cartbay_consent_text, _cartbay_consent_atConsent state and context.
_cartbay_sourceclassic or block.
_cartbay_cart_hash, _cartbay_cart_fingerprintCart identity and dedupe/update inputs.
_cartbay_cart_total, _cartbay_currency, _cartbay_cart_item_countCart value summary.
_cartbay_cart_snapshotRestore-ready cart snapshot.
_cartbay_captured_at, _cartbay_last_activity_at, _cartbay_abandoned_atLifecycle timestamps.
_cartbay_recovered_at, _cartbay_recovered_order_id, _cartbay_recovered_revenueRecovery attribution.
_cartbay_notificationsNotification lifecycle records.
_cartbay_token_hash, _cartbay_token_hashes, _cartbay_token_expires_atRestore token hashes and expiry.
_cartbay_unsub_token_hashUnsubscribe token hash.

CartBay Pro adds its own persisted event/analytics data and dynamic coupon context. These keys exist only when the Pro add-on is active.

Meta keyStored onPurpose
_cartbay_pro_eventsSession orderPersisted session event history for Pro analytics.
_cartbay_pro_notificationsSession orderPersisted per-notification reporting data.
_cartbay_coupon_code, _cartbay_coupon_expires_atSession orderGenerated recovery coupon code and expiry for the session.
_cartbay_generated, _cartbay_session_idGenerated couponMarks a coupon as CartBay-generated and links it to its session.

Session lifecycle events include captured, updated, abandoned, email_sent, email_failed, coupon_suppressed, restore_clicked, cart_restore_started, cart_restored, cart_restore_partial, cart_restore_failed, completed_before_abandonment, recovered, and unsubscribed.

The free plugin fires each event through the cartbay_session_event action (see Hooks & Jobs) but does not persist an event history. The stored, queryable event log (_cartbay_pro_events) is a Pro feature. Pro

Free options:

OptionPurpose
cartbay_settingsCapture, consent, timeout, offers, retention, logs, test mode, and admin navigation.
cartbay_campaign_settingsRecovery sequence enabled state, delay settings, and per-step coupon controls.
cartbay_wizard_completeFirst-run wizard completion flag.
cartbay_sequence_defaults_versionSequence default migration marker.
cartbay_db_versionSchema/migration version marker.
cartbay_log_entriesBounded (~500) in-database CartBay log buffer (non-autoloaded).

Pro options: Pro

OptionPurpose
cartbay_license_dataStored license key and license status data.
cartbay_pro_coupon_settingsDynamic recovery coupon defaults.

Free transients:

TransientPurpose
cartbay_analytics_cacheCached analytics metrics.
cartbay_rl_{endpoint}_{md5(REMOTE_ADDR)}Public endpoint rate-limit counters.
cartbay_notification_ctx_{notification_id}Notification context for mail success/failure hooks.
cartbay_wizard_redirectShort-lived first-run redirect flag.

Pro transients: Pro

TransientPurpose
cartbay_license_validCached license validity for 12 hours.
cartbay_pro_analytics_cacheCached Pro (advanced) analytics metrics.

Suppression entries use a private cartbay_suppressed post type. The post slug/title is the SHA-256 hash of the normalized email. This allows suppression lookup without storing a plain email in the suppression identifier.

Dynamic recovery coupons are a Pro feature. The free plugin does not generate coupons — its offer is a single static WooCommerce coupon code referenced from settings (cartbay_settings['static_coupon_code']) and inserted into emails as plain text.

When Pro is active, it creates a unique per-session WC_Coupon (CARTBAY-<8 alnum>, single-use, email-restricted, with an expiry). The generated coupon carries _cartbay_generated and _cartbay_session_id meta, and the session order stores _cartbay_coupon_code and _cartbay_coupon_expires_at.

Retention is controlled by cartbay_settings['data_retention_days']. The daily cartbay_prune_sessions action delegates cleanup to SessionRepository::prune_expired().