Analytics & Reports

Track rule performance and measure revenue impact

Dashboard Widgets

Access quick insights from your WordPress admin homepage.

Location: WordPress Admin → Dashboard

Cart Guard adds 4 widgets to your main dashboard:

Widget 1: Recent Violations

┌─────────────────────────────────────────────────────┐
│ 🔍 Recent Violations (Last 24 Hours)                │
├─────────────────────────────────────────────────────┤
│ â€ĸ 10:30 AM - Coffee Bundle (Soft-fail) Order #12346│
│ â€ĸ 09:45 AM - Min Cart $50 (Hard-fail) Blocked     │
│ â€ĸ 08:15 AM - Laptop Bundle (Manual) Order #12345   │
│                                                      │
│ [View All Violations →]                             │
└─────────────────────────────────────────────────────┘

Shows:
– Last 5 violations
– Time, rule name, violation type
– Order number (if completed)
– Click any violation → Jump to order details


Widget 2: Validation Stats

┌─────────────────────────────────────────────────────┐
│ 📊 Validation Stats (Last 30 Days)                  │
├─────────────────────────────────────────────────────┤
│ Total Validations: 2,847                            │
│ Clean Orders: 87% (2,477 orders) đŸŸĸ                 │
│ Soft-Fail: 12% (342 orders) 🟡                      │
│ Hard-Fail (Blocked): 1% (28 orders) 🔴             │
│                                                      │
│ Revenue Saved: $24,567                              │
│ (From blocked invalid orders)                       │
│                                                      │
│ [View Analytics →]                                  │
└─────────────────────────────────────────────────────┘

Key Metrics:
Total Validations: Every cart check (add to cart + checkout)
Clean Orders: Passed all rules (no issues)
Soft-Fail: Triggered rule but allowed checkout (yellow badge)
Hard-Fail: Blocked checkout (red badge)
Revenue Saved: Sum of blocked order totals


Widget 3: Top Performing Rules

┌─────────────────────────────────────────────────────┐
│ 🏆 Top Performing Rules (Last 30 Days)              │
├─────────────────────────────────────────────────────┤
│ 1. Coffee + Mug BOGO                                │
│    523 triggers â€ĸ 88% block rate â€ĸ $8,234 saved    │
│                                                      │
│ 2. Minimum Cart Value $50                           │
│    312 triggers â€ĸ 35% block rate â€ĸ $5,890 saved    │
│                                                      │
│ 3. Laptop + Warranty Bundle                         │
│    189 triggers â€ĸ 92% block rate â€ĸ $6,540 saved    │
│                                                      │
│ [View All Rules →]                                  │
└─────────────────────────────────────────────────────┘

Ranking Criteria:
– Sorted by revenue saved (highest first)
– Shows top 3 rules
– Click rule name → Jump to rule editor


Widget 4: Orders Needing Review

┌─────────────────────────────────────────────────────┐
│ âš ī¸ Orders Needing Review                            │
├─────────────────────────────────────────────────────┤
│ 3 orders waiting for manager review                 │
│                                                      │
│ â€ĸ Order #12346 (Nov 14, 10:30 AM)                  │
│ â€ĸ Order #12349 (Nov 13, 3:15 PM)                   │
│ â€ĸ Order #12351 (Nov 12, 8:45 AM)                   │
│                                                      │
│ [Review Orders →]                                   │
└─────────────────────────────────────────────────────┘

Purpose:
– Alerts managers to yellow badge orders
– Shows count and order numbers
– Click “Review Orders” → Filtered orders list

Best Practice: Check this widget daily (morning routine)


Analytics Page (Detailed Reports)

Access comprehensive analytics with filters and export capabilities.

Location: Cart Guard → Analytics

Page Layout

┌─────────────────────────────────────────────────────────────┐
│ Cart Guard Analytics                                         │
├─────────────────────────────────────────────────────────────┤
│ [Filter Panel]                                               │
│ â€ĸ Date Range: [Last 30 Days â–ŧ]                             │
│ â€ĸ Rule: [All Rules â–ŧ]                                       │
│ â€ĸ Violation Type: [All Types â–ŧ]                            │
│ â€ĸ Customer: [All Customers â–ŧ]                              │
│ [Apply Filters] [Reset]                                     │
├─────────────────────────────────────────────────────────────┤
│ [Violation Timeline Chart]                                  │
│ [Interactive bar chart - see below]                         │
├─────────────────────────────────────────────────────────────┤
│ [Violations Table]                                          │
│ [Searchable data table - see below]                        │
├─────────────────────────────────────────────────────────────┤
│ [Export Buttons]                                            │
│ [Export CSV] [Export JSON] [Export Rule Stats]             │
└─────────────────────────────────────────────────────────────┘

Filter Options

Date Range Presets:
– Today
– Yesterday
– Last 7 days
– Last 30 days (default)
– Last 90 days
– Custom range (date picker)

Rule Filter:
– All Rules (default)
– Individual rule dropdown (shows rule names)

Violation Type Filter:
– All Types (default)
– Soft-fail (yellow badges)
– Hard-fail (blocked checkouts)
– Manual orders (blue badges)
– Clean orders (green badges)

Customer Filter:
– All Customers (default)
– Search by email
– Filter by guest vs registered


Violation Timeline Chart

Interactive bar chart showing daily validation results.

┌─────────────────────────────────────────────────────┐
│ Violation Timeline (Nov 1-30, 2025)                 │
├─────────────────────────────────────────────────────┤
│ 100│                                                │
│    │     ████                                       │
│ 80 │     ████  ████                                 │
│    │ ████████  ████████                             │
│ 60 │ ████████  ████████  ████                       │
│    │ ████████  ████████  ████████                   │
│ 40 │ ████████  ████████  ████████████               │
│    │ ████████  ████████  ████████████████           │
│ 20 │ ████████  ████████  ████████████████████       │
│    │ ████████  ████████  ████████████████████████   │
│  0 └──────────────────────────────────────────────  │
│     Nov 1    Nov 8    Nov 15   Nov 22   Nov 29     │
│                                                      │
│ Legend:                                              │
│ đŸŸĸ Green = Clean orders (87%)                       │
│ 🟡 Yellow = Soft-fail (12%)                         │
│ 🔴 Red = Hard-fail (1%)                             │
│ đŸ”ĩ Blue = Manual orders (trace)                     │
└─────────────────────────────────────────────────────┘

Chart Features:
Stacked bars: Each bar = 1 day, segments = violation types
Hover tooltips: Shows exact counts for each type
Click bar: Auto-filters table to that day’s violations
Export chart: Download as PNG image


Violations Data Table

Searchable, sortable table of all validation events.

┌──────────────────────────────────────────────────────────────────────────────┐
│ [Search: ________] [Show: 25 â–ŧ] [Export CSV]                                 │
├─────â”Ŧ─────────────â”Ŧ──────────────────â”Ŧ──────────â”Ŧ──────────â”Ŧ─────────────────┤
│ ID  │ Date/Time   │ Rule             │ Customer │ Order    │ Type            │
├─────â”ŧ─────────────â”ŧ──────────────────â”ŧ──────────â”ŧ──────────â”ŧ─────────────────┤
│ 847 │ Nov 14 10:30│ Coffee + Mug     │ Guest    │ #12346   │ âš ī¸ Soft-fail   │
│ 846 │ Nov 14 10:15│ Min Cart $50     │ J. Smith │ -        │ ❌ Hard-fail   │
│ 845 │ Nov 14 09:45│ Laptop Bundle    │ J. Doe   │ #12345   │ ✅ Passed      │
│ 844 │ Nov 13 16:30│ BOGO Promo       │ Guest    │ #12344   │ âš ī¸ Soft-fail   │
│ 843 │ Nov 13 14:20│ Wholesale Min    │ J. Corp  │ -        │ ❌ Hard-fail   │
│ 842 │ Nov 13 11:45│ Coffee + Mug     │ S. Lee   │ #12343   │ â„šī¸ Manual      │
├─────â”ŧ─────────────â”ŧ──────────────────â”ŧ──────────â”ŧ──────────â”ŧ─────────────────┤
│ [< Previous] Page 1 of 43 [Next >]                                            │
└──────────────────────────────────────────────────────────────────────────────┘

Table Features:

Search Capabilities:
– Search by order number: #12346
– Search by customer email: [email protected]
– Search by rule name: Coffee
– Search by IP address: 192.168.1.100 (fraud investigation)

Column Actions:
Order #: Click to jump to WooCommerce order detail page
Rule: Click to open rule editor
Customer: Click to view customer profile (WooCommerce)

Sorting:
– Click any column header to sort (date, rule name, type)
– Default sort: Newest first

Pagination:
– 25/50/100 rows per page
– Ajax-powered (no page reload)


Export Reports

Cart Guard provides 3 export types for external analysis.

Export 1: Violations CSV

Export detailed violation logs for forensic analysis.

Location: Analytics page → “Export CSV” button

CSV Format:

id,date_time,rule_id,rule_name,customer_email,order_id,violation_type,ip_address,cart_data,user_agent,reviewed_by,review_note,reviewed_at
847,"2025-11-14 10:30:15",735,"Coffee + Mug","[email protected]",12346,"soft_fail_api_down","192.168.1.100","[{\"product_id\":101,\"quantity\":1}]","Mozilla/5.0 (Windows NT 10.0; Win64; x64)","admin","Approved - API was down","2025-11-14 11:00:00"
846,"2025-11-14 10:15:30",740,"Min Cart $50","[email protected]",NULL,"hard_fail_blocked","192.168.1.105","[{\"product_id\":202,\"quantity\":1}]","Mozilla/5.0 (iPhone; CPU iPhone OS 14_0)","","",""

Columns Explained:

Column Description Example
id Violation unique ID 847
date_time When violation occurred 2025-11-14 10:30:15
rule_id Rule database ID 735
rule_name Human-readable rule name Coffee + Mug
customer_email Customer email (or “guest”) [email protected]
order_id WooCommerce order number 12346
violation_type Reason code soft_fail_api_down
ip_address Customer IP address 192.168.1.100
cart_data Full cart snapshot (JSON) [{…}]
user_agent Browser/device info Mozilla/5.0…
reviewed_by Manager who reviewed admin
review_note Manager’s review note Approved – API down
reviewed_at Review timestamp 2025-11-14 11:00:00

Export Use Cases

Fraud Investigation

1. Export violations CSV
2. Filter by IP address in Excel
3. Identify repeat offenders (same IP, multiple violations)
4. Cross-reference with order data
5. Flag suspicious accounts

Customer Support

1. Customer emails: "Why was my order blocked?"
2. Search CSV by email or order number
3. Find exact rule that triggered
4. See cart contents at time of violation
5. Respond with specific explanation

Compliance Audits

1. Export date range (e.g., Q1 2025)
2. Filter by specific rule (e.g., "Age Verification")
3. Prove enforcement to regulators
4. Show manager review notes
5. Archive for legal retention

Data Analysis

1. Import CSV to Excel/Google Sheets
2. Create pivot tables:
   - Violations by hour of day (peak times?)
   - Violations by rule (which rules trigger most?)
   - Block rate by customer type (guests vs registered)
3. Identify optimization opportunities

Export 2: Rule Performance CSV

Export summary statistics for each rule.

Location: Dashboard widget → “Export Rule Stats” button

CSV Format:

rule_id,rule_name,status,total_triggers,soft_fail_count,hard_fail_count,block_rate,revenue_impact,avg_order_value,last_triggered
735,"Coffee + Mug BOGO","active",523,63,460,0.12,"8234.50","15.75","2025-11-14 10:30:15"
740,"Min Cart $50","active",312,89,223,0.35,"5890.00","26.41","2025-11-14 10:15:30"

Columns Explained:

Column Description Example
rule_id Rule database ID 735
rule_name Human-readable name Coffee + Mug BOGO
status Active or inactive active
total_triggers Times rule evaluated 523
soft_fail_count Yellow badge count 63
hard_fail_count Blocked checkouts 460
block_rate Percentage blocked 0.12 (12%)
revenue_impact Sum of blocked order values 8234.50
avg_order_value Average cart value for rule 15.75
last_triggered Most recent trigger 2025-11-14 10:30:15

Export 3: Analytics Summary JSON

Export structured data for API integrations.

Location: Analytics → “Export JSON” button

JSON Format:

{
  "export_date": "2025-11-14T10:30:15Z",
  "date_range": {
    "start": "2025-10-15",
    "end": "2025-11-14"
  },
  "summary": {
    "total_validations": 2847,
    "clean_orders": 2477,
    "soft_fail_count": 342,
    "hard_fail_count": 28,
    "manual_override_count": 147,
    "revenue_saved": 24567.00,
    "avg_cart_value": 45.23
  },
  "top_rules": [
    {
      "rule_id": "735",
      "name": "Coffee + Mug BOGO",
      "triggers": 523,
      "block_rate": 0.12,
      "revenue_impact": 8234.00
    },
    {
      "rule_id": "740",
      "name": "Min Cart $50",
      "triggers": 312,
      "block_rate": 0.35,
      "revenue_impact": 5890.00
    }
  ],
  "timeline": [
    {
      "date": "2025-11-14",
      "soft_fail": 3,
      "hard_fail": 1,
      "clean": 87,
      "manual": 2
    },
    {
      "date": "2025-11-13",
      "soft_fail": 5,
      "hard_fail": 2,
      "clean": 92,
      "manual": 1
    }
  ]
}

Use Cases:
BI Tools: Import to Tableau, Power BI for dashboards
Automated Reporting: Cron jobs pull daily stats
Webhook Notifications: Trigger Slack alerts on thresholds
Custom Integrations: Build your own analytics platform


Real-World Example: Monthly Performance Report

Scenario: Store manager needs to present Cart Guard ROI to owner

Step 1: Export Rule Performance CSV

1. Go to Cart Guard → Dashboard
2. Click "Export Rule Stats" button
3. Open CSV in Excel

Step 2: Create Summary Metrics

Total Rules Active: 12
Total Validations: 8,450
Block Rate: 8.5% (718 blocked orders)
Revenue Saved: $64,320

Step 3: Identify Top 3 Rules

1. Coffee + Mug BOGO - $18,234 saved (28% of total)
2. Laptop + Warranty Bundle - $15,890 saved (25%)
3. Min Cart $50 Wholesale - $12,450 saved (19%)

Step 4: Identify Problem Rules

Rule: "Category Restriction: Electronics"
- Block rate: 45% (too high, customer friction)
- Revenue impact: $2,300 (low despite high blocks)
- Action: Review rule logic, may be too strict

Step 5: Present Findings

"Cart Guard saved $64,320 last month by blocking 718 invalid orders.
Top 3 rules account for 72% of savings. Recommend reviewing
Electronics rule (45% block rate causing customer complaints)."

Best Practices

For Store Managers

  • ✅ Check dashboard daily: Review violations widget every morning
  • ✅ Export monthly reports: Create performance summaries for owners
  • ✅ Investigate spikes: If violations suddenly increase, check rule logic
  • ✅ Track trends: Compare month-over-month block rates
  • âš ī¸ Don’t ignore soft-fails: Yellow badges = potential system issues

For Store Owners

  • ✅ Track ROI: Revenue saved = direct profit impact
  • ✅ Compare rule performance: Pause underperforming rules
  • ✅ Audit exports quarterly: Review compliance for legal/regulatory needs
  • ✅ Share wins with team: Celebrate rules that save significant revenue
  • âš ī¸ Don’t over-optimize: Some rules have indirect value (brand protection)

Troubleshooting

Issue: Charts Not Loading

Symptoms:
– Analytics page shows blank charts
– Browser console errors

Solutions:
1. Hard refresh browser (Ctrl+Shift+R)
2. Clear WordPress cache
3. Check if Chart.js library loaded (F12 → Network tab)
4. Disable conflicting plugins (deactivate 1 by 1)


Issue: Export CSV Empty

Symptoms:
– Click “Export CSV” button
– Download starts but file is empty

Solutions:
1. Check date range filter (too narrow?)
2. Check if any violations exist in that range
3. Try “Export JSON” instead (different code path)
4. Check PHP error log for permission issues


Next Steps

Now that you understand analytics:


Last Updated: November 14, 2025
Plugin Version: 1.0

← Back: Managing Orders | Next: Troubleshooting →