1496 lines
100 KiB
HTML
1496 lines
100 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>CartPulse AI — Documentation</title>
|
|
<style>
|
|
/* ── Reset & Base ── */
|
|
*,*::before,*::after{box-sizing:border-box}
|
|
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,sans-serif;line-height:1.7;color:#1e1e1e;margin:0;padding:0;background:#f9fafb}
|
|
a{color:#2271b1;text-decoration:none}
|
|
a:hover{text-decoration:underline}
|
|
img{max-width:100%}
|
|
|
|
/* ── Layout ── */
|
|
.wrap{max-width:900px;margin:0 auto;padding:2rem 1.5rem 4rem}
|
|
|
|
/* ── Sticky Top Nav ── */
|
|
.topnav{position:sticky;top:0;z-index:100;background:#1d2327;color:#f0f0f1;padding:0.6rem 1.5rem;font-size:0.85rem;display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
|
|
.topnav .brand{font-weight:700;font-size:1rem;white-space:nowrap}
|
|
.topnav .badge{background:#2271b1;color:#fff;padding:2px 8px;border-radius:10px;font-size:0.75rem;font-weight:600}
|
|
.topnav a{color:#a7aaad}
|
|
.topnav a:hover{color:#fff;text-decoration:none}
|
|
.topnav .sep{color:#3c434a}
|
|
|
|
/* ── Back to Top ── */
|
|
.btt{position:fixed;bottom:2rem;right:2rem;width:42px;height:42px;background:#2271b1;color:#fff;border:none;border-radius:50%;font-size:1.3rem;cursor:pointer;display:none;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.25);z-index:99}
|
|
.btt:hover{background:#135e96}
|
|
|
|
/* ── Headings ── */
|
|
h1{font-size:2rem;border-bottom:3px solid #2271b1;padding-bottom:0.5rem;margin-top:0}
|
|
h2{font-size:1.45rem;color:#2271b1;border-bottom:1px solid #dcdcde;padding-bottom:0.3rem;margin-top:3rem}
|
|
h3{font-size:1.15rem;color:#1d2327;margin-top:1.8rem}
|
|
h4{font-size:1rem;color:#3c434a;margin-top:1.2rem}
|
|
|
|
/* ── Callout Boxes ── */
|
|
.tip,.warn,.note,.info{padding:0.85rem 1.1rem;margin:1.2rem 0;border-radius:0 6px 6px 0;font-size:0.93rem}
|
|
.tip{background:#ecfdf5;border-left:4px solid #059669}
|
|
.warn{background:#fef2f2;border-left:4px solid #dc2626}
|
|
.note{background:#fffbeb;border-left:4px solid #d97706}
|
|
.info{background:#eff6ff;border-left:4px solid #2563eb}
|
|
.tip strong,.warn strong,.note strong,.info strong{display:block;margin-bottom:2px}
|
|
|
|
/* ── Tables ── */
|
|
table{border-collapse:collapse;width:100%;margin:1rem 0;font-size:0.92rem}
|
|
th,td{border:1px solid #dcdcde;padding:0.55rem 0.75rem;text-align:left}
|
|
th{background:#f0f0f1;font-weight:600;white-space:nowrap}
|
|
tr:nth-child(even){background:#f9f9f9}
|
|
.compact-table td,.compact-table th{padding:0.35rem 0.6rem;font-size:0.88rem}
|
|
|
|
/* ── Code ── */
|
|
code{background:#f0f0f1;padding:0.15em 0.45em;border-radius:3px;font-size:0.88em;font-family:"SF Mono",Consolas,"Liberation Mono",Menlo,monospace}
|
|
pre{background:#1d2327;color:#f0f0f1;padding:1.1rem 1.25rem;border-radius:6px;overflow-x:auto;font-size:0.85rem;line-height:1.6;margin:1rem 0}
|
|
pre code{background:none;padding:0;color:inherit;font-size:inherit}
|
|
|
|
/* ── Lists ── */
|
|
ul,ol{margin:0.5rem 0 1rem 1.5rem}
|
|
li{margin-bottom:0.3rem}
|
|
li > ul,li > ol{margin-top:0.3rem}
|
|
|
|
/* ── TOC ── */
|
|
.toc{background:#fff;border:1px solid #dcdcde;border-radius:8px;padding:1.5rem 2rem;margin:2rem 0;columns:2;column-gap:2rem}
|
|
.toc h2{border:none;margin:0 0 0.75rem;padding:0;column-span:all;font-size:1.2rem}
|
|
.toc ol{margin:0;padding-left:1.5rem;list-style:decimal}
|
|
.toc li{break-inside:avoid;margin-bottom:0.25rem;font-size:0.9rem}
|
|
|
|
/* ── Section Numbers ── */
|
|
.snum{color:#2271b1;margin-right:0.3rem}
|
|
|
|
/* ── Feature Grid ── */
|
|
.fgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:1rem;margin:1rem 0}
|
|
.fcard{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem 1.2rem}
|
|
.fcard h4{margin:0 0 0.4rem;font-size:0.95rem}
|
|
.fcard p{margin:0;font-size:0.88rem;color:#4b5563}
|
|
|
|
/* ── HR ── */
|
|
hr{border:none;border-top:1px solid #dcdcde;margin:2.5rem 0}
|
|
|
|
/* ── Cover ── */
|
|
.cover{text-align:center;padding:2rem 0 1rem}
|
|
.cover h1{border:none;font-size:2.2rem}
|
|
.cover .meta{color:#6b7280;font-size:0.95rem;margin-top:0.5rem}
|
|
.cover .req{display:inline-flex;gap:1rem;flex-wrap:wrap;justify-content:center;margin-top:1rem}
|
|
.cover .req span{background:#f0f0f1;padding:4px 12px;border-radius:20px;font-size:0.82rem;font-weight:500}
|
|
|
|
/* ── Responsive ── */
|
|
@media(max-width:700px){
|
|
.toc{columns:1}
|
|
.topnav{font-size:0.78rem;gap:0.5rem}
|
|
.wrap{padding:1.5rem 1rem 3rem}
|
|
.fgrid{grid-template-columns:1fr}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- ═══ TOP NAV ═══ -->
|
|
<nav class="topnav" id="top">
|
|
<a href="../index.html" class="brand" style="display:inline-flex;align-items:center;gap:0.45rem;color:#f0f0f1;text-decoration:none">
|
|
<img src="../assets/img/logo.png" alt="CartPulse AI" width="22" height="22" style="border-radius:6px;vertical-align:middle">
|
|
<span>CartPulse AI</span>
|
|
</a>
|
|
<span class="badge">v1.0.0</span>
|
|
<span class="sep">|</span>
|
|
<a href="../index.html">Home</a>
|
|
<a href="../support.html">Support</a>
|
|
<span class="sep">|</span>
|
|
<a href="#toc">Contents</a>
|
|
<a href="#installation">Install</a>
|
|
<a href="#wizard">Wizard</a>
|
|
<a href="#campaigns">Campaigns</a>
|
|
<a href="#analytics">Analytics</a>
|
|
<a href="#settings-ref">Settings</a>
|
|
<a href="#rest-api">API</a>
|
|
<a href="#troubleshooting">Help</a>
|
|
</nav>
|
|
|
|
<div class="wrap">
|
|
|
|
<!-- ═══ 1. COVER ═══ -->
|
|
<div class="cover" id="cover">
|
|
<h1>CartPulse AI</h1>
|
|
<p style="font-size:1.1rem;color:#4b5563;margin:0.5rem 0">AI-Powered Cart Abandonment Prevention for WooCommerce</p>
|
|
<p class="meta">By Earlybirds — Version 1.0.0</p>
|
|
<div class="req">
|
|
<span>WordPress 6.0+</span>
|
|
<span>PHP 7.4+</span>
|
|
<span>WooCommerce 8.0+</span>
|
|
</div>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<!-- ═══ 2. TABLE OF CONTENTS ═══ -->
|
|
<div class="toc" id="toc">
|
|
<h2>Table of Contents</h2>
|
|
<ol>
|
|
<li><a href="#intro">Introduction & Overview</a></li>
|
|
<li><a href="#installation">Installation & Activation</a></li>
|
|
<li><a href="#wizard">Setup Wizard</a></li>
|
|
<li><a href="#dashboard">Dashboard</a></li>
|
|
<li><a href="#campaigns">Campaign Management</a></li>
|
|
<li><a href="#triggers">Trigger Configuration</a></li>
|
|
<li><a href="#interventions">Intervention Content & Design</a></li>
|
|
<li><a href="#merge-tags">Merge Tags Reference</a></li>
|
|
<li><a href="#coupons">Coupon Configuration</a></li>
|
|
<li><a href="#live-preview">Live Campaign Preview</a></li>
|
|
<li><a href="#scheduling">Campaign Scheduling</a></li>
|
|
<li><a href="#import-export">Campaign Import / Export</a></li>
|
|
<li><a href="#presets">Preset Library</a></li>
|
|
<li><a href="#ab-testing">A/B Testing</a></li>
|
|
<li><a href="#spin-wheel">Spin-to-Win Wheel</a></li>
|
|
<li><a href="#analytics">Analytics Dashboard</a></li>
|
|
<li><a href="#live-visitors">Live Visitors Dashboard</a></li>
|
|
<li><a href="#cart-recovery">Cart Recovery Emails</a></li>
|
|
<li><a href="#settings-ref">Complete Settings Reference</a></li>
|
|
<li><a href="#tools">Tools & Diagnostics</a></li>
|
|
<li><a href="#rest-api">REST API Reference</a></li>
|
|
<li><a href="#webhooks">Webhooks</a></li>
|
|
<li><a href="#wp-cli">WP-CLI Commands</a></li>
|
|
<li><a href="#hooks">Hooks & Filters Reference</a></li>
|
|
<li><a href="#privacy">Privacy & GDPR</a></li>
|
|
<li><a href="#storefront">How the Storefront Works</a></li>
|
|
<li><a href="#demo-data">Demo Data System</a></li>
|
|
<li><a href="#compatibility">Compatibility</a></li>
|
|
<li><a href="#troubleshooting">Troubleshooting</a></li>
|
|
<li><a href="#faq">FAQ</a></li>
|
|
<li><a href="#changelog">Changelog</a></li>
|
|
<li><a href="#support">Support & Credits</a></li>
|
|
</ol>
|
|
</div>
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 1. INTRODUCTION -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="intro"><span class="snum">1.</span> Introduction & Overview</h2>
|
|
|
|
<p>CartPulse AI is a WooCommerce plugin that detects when visitors are about to abandon your store and delivers intelligent, AI-powered interventions to recover lost sales. It combines real-time behavior tracking, exit-intent detection, and optional AI content generation to show the right message at the right moment — turning abandoned carts into completed purchases.</p>
|
|
|
|
<h3>How It Works</h3>
|
|
<ol>
|
|
<li><strong>Track</strong> — The storefront script silently monitors visitor behavior: scroll depth, time on page, cart activity, tab switches, and checkout progress.</li>
|
|
<li><strong>Score</strong> — An intent scoring engine calculates a 0–100 purchase-intent score in real time based on 12 weighted signals.</li>
|
|
<li><strong>Trigger</strong> — When behavior matches your campaign rules (exit intent, idle timeout, cart value threshold, etc.), a campaign fires.</li>
|
|
<li><strong>Intervene</strong> — A personalized popup, slide-in, bar, or spin-to-win wheel appears with the right message and offer.</li>
|
|
<li><strong>Convert</strong> — Revenue attribution tracks which interventions drove completed purchases, giving you exact ROI data.</li>
|
|
<li><strong>Measure</strong> — Interactive analytics charts show revenue saved, strategy effectiveness, and funnel performance.</li>
|
|
</ol>
|
|
|
|
<h3>Key Features at a Glance</h3>
|
|
<div class="fgrid">
|
|
<div class="fcard"><h4>9 Trigger Types</h4><p>Exit intent, idle timeout, scroll depth, tab switch, cart value, checkout abandon, URL pattern, referrer match, cart contains.</p></div>
|
|
<div class="fcard"><h4>7 Template Styles</h4><p>Popup, slide-in, top bar, bottom bar, fullscreen, inline, and spin-to-win wheel.</p></div>
|
|
<div class="fcard"><h4>6 Intervention Strategies</h4><p>Personalized discounts, free shipping, social proof, urgency, objection handling, value reminders.</p></div>
|
|
<div class="fcard"><h4>AI-Enhanced Content</h4><p>Optional OpenAI / Anthropic integration for dynamic, context-aware messaging. Works great without AI too.</p></div>
|
|
<div class="fcard"><h4>Visual Analytics</h4><p>4 Chart.js-powered charts: revenue line, bar, donut, and funnel. CSV export included.</p></div>
|
|
<div class="fcard"><h4>12 Campaign Presets</h4><p>Ready-made, one-click campaigns covering urgency, discounts, social proof, recovery, and gamification.</p></div>
|
|
<div class="fcard"><h4>A/B Testing</h4><p>Split test variants with auto-winner detection at a configurable statistical confidence threshold.</p></div>
|
|
<div class="fcard"><h4>Privacy-First</h4><p>Auto-detects 6 consent plugins, respects DNT, GDPR exporters/erasers, configurable data retention.</p></div>
|
|
</div>
|
|
|
|
<h3>Works Without AI</h3>
|
|
<p>CartPulse AI ships with built-in templates that use <strong>merge tags</strong> to pull real WooCommerce data (cart totals, recent purchases, product ratings). No API key is required for core functionality. Adding an AI provider (OpenAI or Anthropic) enhances interventions with dynamically generated, context-aware copy. You control costs via a monthly budget cap.</p>
|
|
|
|
<h3>System Requirements</h3>
|
|
<table>
|
|
<tr><th>Requirement</th><th>Minimum</th><th>Recommended</th></tr>
|
|
<tr><td>WordPress</td><td>6.0</td><td>6.4+</td></tr>
|
|
<tr><td>PHP</td><td>7.4</td><td>8.1+</td></tr>
|
|
<tr><td>WooCommerce</td><td>8.0</td><td>9.0+</td></tr>
|
|
<tr><td>MySQL / MariaDB</td><td>5.7 / 10.3</td><td>8.0 / 10.6</td></tr>
|
|
<tr><td>PHP Extensions</td><td>—</td><td>sodium (for API key encryption)</td></tr>
|
|
<tr><td>Memory Limit</td><td>128 MB</td><td>256 MB</td></tr>
|
|
</table>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 2. INSTALLATION -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="installation"><span class="snum">2.</span> Installation & Activation</h2>
|
|
|
|
<h3>Method A — WordPress Admin Upload</h3>
|
|
<ol>
|
|
<li>Download the <code>cartpulse-ai.zip</code> file from your CodeCanyon purchase.</li>
|
|
<li>In WordPress, navigate to <strong>Plugins → Add New → Upload Plugin</strong>.</li>
|
|
<li>Choose the ZIP file and click <strong>Install Now</strong>.</li>
|
|
<li>After installation completes, click <strong>Activate Plugin</strong>.</li>
|
|
</ol>
|
|
|
|
<h3>Method B — FTP / File Manager</h3>
|
|
<ol>
|
|
<li>Extract the ZIP file on your computer.</li>
|
|
<li>Upload the <code>cartpulse-ai</code> folder to <code>wp-content/plugins/</code> via FTP or your hosting file manager.</li>
|
|
<li>In WordPress, go to <strong>Plugins</strong> and click <strong>Activate</strong> next to CartPulse AI.</li>
|
|
</ol>
|
|
|
|
<h3>What Happens on Activation</h3>
|
|
<p>When you activate CartPulse AI for the first time, the plugin automatically:</p>
|
|
<ol>
|
|
<li><strong>Creates 7 database tables</strong> — sessions, behavior events, campaigns, intervention logs, analytics, token usage, and cart recovery.</li>
|
|
<li><strong>Sets default settings</strong> — Safe defaults for tracking, privacy, and behavior configuration.</li>
|
|
<li><strong>Registers cron events</strong> — 6 scheduled tasks for analytics aggregation, data cleanup, coupon cleanup, schedule processing, optional purchase verification, and cart recovery emails.</li>
|
|
<li><strong>Imports demo data</strong> — Sample campaigns and 60 days of synthetic analytics data so you can explore all features immediately.</li>
|
|
<li><strong>Redirects to the Setup Wizard</strong> — A 5-step onboarding wizard guides you through initial configuration.</li>
|
|
</ol>
|
|
|
|
<div class="tip"><strong>Tip:</strong> Demo data can be cleared at any time from the <strong>Dashboard</strong> (dismiss banner) or <strong>Tools → Clear Demo Data</strong>.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 3. SETUP WIZARD -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="wizard"><span class="snum">3.</span> Setup Wizard (5 Steps)</h2>
|
|
|
|
<p>The setup wizard runs automatically on first activation and can be accessed later from <strong>CartPulse AI → Setup Wizard</strong>. It has 5 steps:</p>
|
|
|
|
<h3>Step 1 — Preflight Checks</h3>
|
|
<p>The wizard verifies your environment before proceeding:</p>
|
|
<table>
|
|
<tr><th>Check</th><th>Required</th><th>Action if Failed</th></tr>
|
|
<tr><td>WooCommerce active (≥ 8.0)</td><td>Yes</td><td>Install and activate WooCommerce</td></tr>
|
|
<tr><td>PHP version (≥ 7.4)</td><td>Yes</td><td>Upgrade PHP via your hosting panel</td></tr>
|
|
<tr><td>libsodium extension</td><td>No (recommended)</td><td>Contact host to enable <code>ext-sodium</code></td></tr>
|
|
<tr><td>Database tables installed</td><td>Yes</td><td>Run migrations from Tools page</td></tr>
|
|
<tr><td>Memory limit (≥ 128 MB)</td><td>No (recommended)</td><td>Increase in <code>php.ini</code> or <code>wp-config.php</code></td></tr>
|
|
</table>
|
|
<p>If any required check fails, the <strong>Next</strong> button is disabled until the issue is resolved.</p>
|
|
|
|
<h3>Step 2 — AI Provider Setup</h3>
|
|
<p>Configure your AI provider for dynamic content generation. This step is <strong>optional</strong> — you can skip it and use static templates with merge tags.</p>
|
|
<ul>
|
|
<li><strong>Provider</strong> — Choose OpenAI or Anthropic (or leave blank to skip).</li>
|
|
<li><strong>API Key</strong> — Enter your key. It is encrypted at rest using libsodium and never displayed after saving.</li>
|
|
<li><strong>Test Connection</strong> — Verify the key works before continuing.</li>
|
|
<li><strong>Monthly Budget (USD)</strong> — Hard cap on AI API spending (default: $50). When the budget is reached, campaigns fall back to static content.</li>
|
|
<li><strong>Default Tone</strong> — Friendly, Professional, Urgent, or Casual.</li>
|
|
</ul>
|
|
|
|
<h3>Step 3 — Behavior & Privacy</h3>
|
|
<ul>
|
|
<li><strong>Excluded Roles</strong> — Select WordPress roles that should never see interventions (Administrator and Shop Manager are excluded by default).</li>
|
|
<li><strong>Respect Do Not Track</strong> — Whether to honor the browser DNT header.</li>
|
|
<li><strong>Session Timeout</strong> — Minutes of inactivity before a session expires (default: 30).</li>
|
|
<li><strong>Data Retention</strong> — Days to keep behavior data before automatic purge (default: 30, max: 365).</li>
|
|
</ul>
|
|
|
|
<h3>Step 4 — First Campaign</h3>
|
|
<p>Choose from 3 recommended presets to launch immediately, or skip to configure campaigns manually later:</p>
|
|
<ul>
|
|
<li><strong>Flash Urgency Countdown</strong> — Exit-intent popup with urgency messaging and 10% coupon.</li>
|
|
<li><strong>Free Shipping Nudge</strong> — Top bar on cart page encouraging customers to add more for free shipping.</li>
|
|
<li><strong>Personalized Discount Offer</strong> — AI-generated exit-intent popup with 10% discount (requires AI key).</li>
|
|
</ul>
|
|
|
|
<h3>Step 5 — Done</h3>
|
|
<p>Summary of your configuration: AI provider status, number of campaigns created, tracking status. Quick links to Dashboard, Campaigns, and Settings pages.</p>
|
|
|
|
<div class="info"><strong>Info:</strong> The wizard can be re-run at any time. It will not overwrite existing settings unless you submit a step.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 4. DASHBOARD -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="dashboard"><span class="snum">4.</span> Dashboard</h2>
|
|
|
|
<p>The main dashboard provides a high-level overview of your store’s performance. Access it from <strong>CartPulse AI → Dashboard</strong>.</p>
|
|
|
|
<h3>KPI Cards</h3>
|
|
<p>Eight stat cards display at the top of the dashboard, each with a colored left border for quick scanning:</p>
|
|
<table>
|
|
<tr><th>Card</th><th>Color</th><th>Description</th></tr>
|
|
<tr><td>Revenue Saved</td><td>Green</td><td>Total revenue attributed to intervention-assisted conversions.</td></tr>
|
|
<tr><td>Sessions</td><td>Blue</td><td>Unique visitor sessions tracked in the selected date range.</td></tr>
|
|
<tr><td>Interventions Shown</td><td>Amber</td><td>Number of times a campaign intervention was displayed.</td></tr>
|
|
<tr><td>Conversions</td><td>Green</td><td>Sessions that saw an intervention and completed a purchase.</td></tr>
|
|
<tr><td>Conversion Rate</td><td>Green</td><td>Conversions divided by interventions shown (percentage).</td></tr>
|
|
<tr><td>Active Campaigns</td><td>Blue</td><td>Number of currently active campaigns.</td></tr>
|
|
<tr><td>AI Budget Used</td><td>Amber</td><td>Current month AI API spend vs. budget limit.</td></tr>
|
|
<tr><td>ROI</td><td>Green</td><td>Revenue saved divided by estimated AI API cost.</td></tr>
|
|
</table>
|
|
|
|
<h3>Date Range Picker</h3>
|
|
<p>Filter all dashboard data by 7-day, 30-day, or 90-day periods using the date range selector in the top-right corner.</p>
|
|
|
|
<h3>Preview Mode</h3>
|
|
<p>Toggle <strong>Preview Mode</strong> from the dashboard to test interventions as an admin without affecting live visitors. When enabled, an amber “Preview Mode: ON” indicator appears in the WordPress admin bar on the frontend.</p>
|
|
|
|
<h3>Top Campaigns Table</h3>
|
|
<p>Shows your top-performing campaigns ranked by conversion rate, with columns for impressions, conversions, revenue, and status.</p>
|
|
|
|
<h3>Demo Data Banner</h3>
|
|
<p>If demo data is loaded, a dismissible banner appears at the top. Click <strong>Clear Demo Data</strong> to remove all synthetic data and start fresh with real analytics.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 5. CAMPAIGN MANAGEMENT -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="campaigns"><span class="snum">5.</span> Campaign Management</h2>
|
|
|
|
<p>Campaigns are the core building block of CartPulse AI. Each campaign defines <em>when</em> to show an intervention (trigger), <em>what</em> to show (intervention content and design), and <em>who</em> should see it (targeting conditions).</p>
|
|
|
|
<h3>Campaign List</h3>
|
|
<p>The campaign list page (<strong>CartPulse AI → Campaigns</strong>) shows all campaigns with:</p>
|
|
<ul>
|
|
<li><strong>Status badges</strong> — Pill-shaped indicators: Active (green), Draft (gray), Paused (amber), Scheduled (blue).</li>
|
|
<li><strong>Bulk actions</strong> — Activate, pause, or delete multiple campaigns at once.</li>
|
|
<li><strong>Quick filters</strong> — Filter by status (all, active, draft, paused).</li>
|
|
<li><strong>Priority</strong> — Numeric priority (1–100). Higher-priority campaigns are evaluated first when multiple campaigns match.</li>
|
|
</ul>
|
|
|
|
<h3>Creating a Campaign</h3>
|
|
<p>Click <strong>Add New Campaign</strong> or apply a preset from the <a href="#presets">Preset Library</a>. The campaign editor has these sections:</p>
|
|
<ol>
|
|
<li><strong>Name & Status</strong> — Campaign name (internal), status (draft/active/paused), priority (1–100).</li>
|
|
<li><strong>Trigger Configuration</strong> — See <a href="#triggers">Section 6</a>.</li>
|
|
<li><strong>Intervention Content</strong> — See <a href="#interventions">Section 7</a>.</li>
|
|
<li><strong>Coupon Configuration</strong> — See <a href="#coupons">Section 9</a>.</li>
|
|
<li><strong>Design Options</strong> — Theme, accent color, animation, border radius.</li>
|
|
<li><strong>A/B Testing</strong> — See <a href="#ab-testing">Section 14</a>.</li>
|
|
<li><strong>Schedule</strong> — See <a href="#scheduling">Section 11</a>.</li>
|
|
</ol>
|
|
|
|
<h3>Campaign Fields Reference</h3>
|
|
<table>
|
|
<tr><th>Field</th><th>Type</th><th>Description</th></tr>
|
|
<tr><td>name</td><td>Text</td><td>Internal campaign name (not shown to visitors).</td></tr>
|
|
<tr><td>status</td><td>Select</td><td>draft, active, paused.</td></tr>
|
|
<tr><td>priority</td><td>Number</td><td>1–100. Higher = evaluated first. Default: 60.</td></tr>
|
|
<tr><td>trigger_config</td><td>Object</td><td>Trigger type, frequency, conditions. See <a href="#triggers">Section 6</a>.</td></tr>
|
|
<tr><td>intervention</td><td>Object</td><td>Template type, content mode, headline, body, CTA, design.</td></tr>
|
|
<tr><td>coupon_config</td><td>Object/null</td><td>Auto-generated coupon settings or null for no coupon.</td></tr>
|
|
<tr><td>ab_test_config</td><td>Object/null</td><td>Variant B content, split ratio.</td></tr>
|
|
<tr><td>schedule_config</td><td>Object/null</td><td>Date range, day-of-week, time window.</td></tr>
|
|
</table>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 6. TRIGGER CONFIGURATION -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="triggers"><span class="snum">6.</span> Trigger Configuration</h2>
|
|
|
|
<p>Triggers define the behavioral signal that causes a campaign’s intervention to fire. Each campaign has exactly one trigger type.</p>
|
|
|
|
<h3>Trigger Types</h3>
|
|
<table>
|
|
<tr><th>Type</th><th>Slug</th><th>Description</th></tr>
|
|
<tr><td>Exit Intent</td><td><code>exit_intent</code></td><td>Fires when the mouse cursor leaves the viewport toward the browser bar (desktop) or rapid scroll-up (mobile).</td></tr>
|
|
<tr><td>Idle Timeout</td><td><code>idle_timeout</code></td><td>Fires after N seconds of no interaction while items are in the cart. Configure <code>timeout_seconds</code>.</td></tr>
|
|
<tr><td>Scroll Depth</td><td><code>scroll_depth</code></td><td>Fires when the visitor scrolls past a configured percentage of the page. Configure <code>scroll_pct</code> (e.g., 60).</td></tr>
|
|
<tr><td>Tab Switch</td><td><code>tab_switch</code></td><td>Fires when the visitor switches to a different browser tab (comparison shopping signal).</td></tr>
|
|
<tr><td>Cart Value</td><td><code>cart_value</code></td><td>Fires when the cart total exceeds a threshold. Configure <code>cart_value_threshold</code>.</td></tr>
|
|
<tr><td>Checkout Abandon</td><td><code>checkout_abandon</code></td><td>Fires when the visitor shows signs of leaving the checkout page without completing the order.</td></tr>
|
|
<tr><td>URL Pattern</td><td><code>url_pattern</code></td><td>Fires on pages matching a URL pattern (e.g., <code>/product/sale-*</code>).</td></tr>
|
|
<tr><td>Referrer Match</td><td><code>referrer_match</code></td><td>Fires when the visitor arrived from a specific referrer domain (e.g., <code>google.com</code>).</td></tr>
|
|
<tr><td>Cart Contains</td><td><code>cart_contains</code></td><td>Fires when the cart contains specific product IDs or category slugs.</td></tr>
|
|
</table>
|
|
|
|
<h3>Frequency Options</h3>
|
|
<table>
|
|
<tr><th>Frequency</th><th>Description</th></tr>
|
|
<tr><td><code>always</code></td><td>Fire every time the trigger condition is met.</td></tr>
|
|
<tr><td><code>once_per_session</code></td><td>Fire only once per visitor session.</td></tr>
|
|
<tr><td><code>once_per_day</code></td><td>Fire at most once per calendar day per visitor.</td></tr>
|
|
<tr><td><code>once_per_visitor</code></td><td>Fire only once ever per visitor (cookie-based).</td></tr>
|
|
</table>
|
|
|
|
<h3>Targeting Conditions</h3>
|
|
<p>Each trigger supports additional conditions that must be met alongside the trigger event:</p>
|
|
<table>
|
|
<tr><th>Condition</th><th>Description</th></tr>
|
|
<tr><td><code>min_intent_score</code></td><td>Minimum purchase-intent score (0–100) the visitor must have.</td></tr>
|
|
<tr><td><code>min_cart_value</code></td><td>Minimum cart value (in store currency) before the trigger fires.</td></tr>
|
|
<tr><td><code>device_type</code></td><td><code>all</code>, <code>desktop</code>, or <code>mobile</code>.</td></tr>
|
|
<tr><td><code>page_type</code></td><td><code>all</code>, <code>product</code>, <code>category</code>, <code>cart</code>, <code>checkout</code>, <code>shop</code>, or <code>other</code>.</td></tr>
|
|
</table>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 7. INTERVENTION CONTENT & DESIGN -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="interventions"><span class="snum">7.</span> Intervention Content & Design</h2>
|
|
|
|
<h3>Template Types</h3>
|
|
<table>
|
|
<tr><th>Type</th><th>Slug</th><th>Description</th></tr>
|
|
<tr><td>Popup</td><td><code>popup</code></td><td>Centered modal overlay with headline, body, CTA buttons, and optional close button.</td></tr>
|
|
<tr><td>Slide-in</td><td><code>slide_in</code></td><td>Small panel that slides in from the bottom-right corner of the viewport.</td></tr>
|
|
<tr><td>Top Bar</td><td><code>top_bar</code></td><td>Full-width notification strip at the top of the page.</td></tr>
|
|
<tr><td>Bottom Bar</td><td><code>bottom_bar</code></td><td>Full-width notification strip at the bottom of the page.</td></tr>
|
|
<tr><td>Fullscreen</td><td><code>fullscreen</code></td><td>Full-viewport overlay with centered content and background dimming.</td></tr>
|
|
<tr><td>Inline</td><td><code>inline</code></td><td>Embedded directly in the page content (non-overlay).</td></tr>
|
|
<tr><td>Spin Wheel</td><td><code>spin_wheel</code></td><td>Gamified spinning wheel with configurable prize slices. See <a href="#spin-wheel">Section 15</a>.</td></tr>
|
|
</table>
|
|
|
|
<h3>Content Mode</h3>
|
|
<ul>
|
|
<li><strong>Static</strong> (<code>content_mode: static</code>) — You write the headline, body, and CTA text manually. Use <a href="#merge-tags">merge tags</a> for dynamic personalization. Works without an AI provider.</li>
|
|
<li><strong>AI-Generated</strong> (<code>content_mode: ai_generated</code>) — The AI provider generates headline and body text based on cart context, store name, configured tone, and campaign instructions. Your static text serves as a fallback if the AI budget is reached or the API is unavailable.</li>
|
|
</ul>
|
|
|
|
<h3>Content Fields</h3>
|
|
<table>
|
|
<tr><th>Field</th><th>Description</th></tr>
|
|
<tr><td><code>headline</code></td><td>Main heading text displayed at the top of the intervention.</td></tr>
|
|
<tr><td><code>body</code></td><td>Body copy supporting the headline.</td></tr>
|
|
<tr><td><code>cta_text</code></td><td>Primary call-to-action button label.</td></tr>
|
|
<tr><td><code>cta_action</code></td><td>What happens on CTA click: <code>apply_coupon</code>, <code>redirect</code>, <code>close</code>, or <code>spin</code>.</td></tr>
|
|
<tr><td><code>cta_url</code></td><td>URL to redirect to (when <code>cta_action</code> is <code>redirect</code>). Defaults to cart page.</td></tr>
|
|
<tr><td><code>secondary_cta_text</code></td><td>Optional dismiss button text (e.g., “No thanks”).</td></tr>
|
|
</table>
|
|
|
|
<h3>Design Options</h3>
|
|
<table>
|
|
<tr><th>Option</th><th>Values</th><th>Description</th></tr>
|
|
<tr><td>Theme</td><td><code>light</code>, <code>dark</code>, <code>brand</code></td><td>Color scheme for the intervention panel.</td></tr>
|
|
<tr><td>Accent Color</td><td>Hex color</td><td>Applied to CTA buttons and borders.</td></tr>
|
|
<tr><td>Border Radius</td><td>Pixels</td><td>Corner rounding for the intervention container.</td></tr>
|
|
<tr><td>Overlay Opacity</td><td>0–1</td><td>Background dimming for popup/fullscreen types.</td></tr>
|
|
<tr><td>Animation</td><td><code>fade</code>, <code>fade-up</code>, <code>slide</code>, <code>slide-left</code>, <code>bounce</code></td><td>Entry animation when the intervention appears.</td></tr>
|
|
</table>
|
|
|
|
<div class="tip"><strong>Tip:</strong> All design changes are previewed in real time in the <a href="#live-preview">Live Campaign Preview</a> panel.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 8. MERGE TAGS -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="merge-tags"><span class="snum">8.</span> Merge Tags Reference</h2>
|
|
|
|
<p>Merge tags allow static templates to display dynamic, real-time data from your store. Insert them in headline, body, or CTA text fields.</p>
|
|
|
|
<table>
|
|
<tr><th>Tag</th><th>Description</th><th>Example Output</th></tr>
|
|
<tr><td><code>{cart_total}</code></td><td>Current cart total in store currency.</td><td>$89.99</td></tr>
|
|
<tr><td><code>{cart_count}</code></td><td>Number of items in the cart.</td><td>3</td></tr>
|
|
<tr><td><code>{product_name}</code></td><td>Name of the first product in the cart.</td><td>Premium Wireless Headphones</td></tr>
|
|
<tr><td><code>{discount_amount}</code></td><td>The coupon discount value (from coupon config).</td><td>10%</td></tr>
|
|
<tr><td><code>{savings_display}</code></td><td>Calculated savings amount in currency.</td><td>$9.00</td></tr>
|
|
<tr><td><code>{expiry_hours}</code></td><td>Hours until the coupon expires.</td><td>24</td></tr>
|
|
<tr><td><code>{recent_purchases}</code></td><td>Real WooCommerce order count in the last 24 hours.</td><td>47</td></tr>
|
|
<tr><td><code>{recent_buyers}</code></td><td>Unique customers who ordered in the last 24 hours.</td><td>23</td></tr>
|
|
<tr><td><code>{product_rating}</code></td><td>Average product rating (from WooCommerce reviews).</td><td>4.7</td></tr>
|
|
<tr><td><code>{review_count}</code></td><td>Number of product reviews.</td><td>128</td></tr>
|
|
<tr><td><code>{store_name}</code></td><td>Your store/site name from WordPress settings.</td><td>My Store</td></tr>
|
|
<tr><td><code>{shipping_gap}</code></td><td>Amount remaining to reach free shipping threshold.</td><td>$11.01</td></tr>
|
|
<tr><td><code>{shipping_threshold}</code></td><td>Free shipping threshold from plugin settings.</td><td>$100.00</td></tr>
|
|
<tr><td><code>{coupon_code}</code></td><td>The auto-generated coupon code.</td><td>FLASH-A1B2C3</td></tr>
|
|
</table>
|
|
|
|
<div class="note"><strong>Note:</strong> Social proof tags (<code>{recent_purchases}</code>, <code>{recent_buyers}</code>, <code>{product_rating}</code>, <code>{review_count}</code>) pull real data from your WooCommerce orders and product meta. Data is cached for 15 minutes.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 9. COUPON CONFIGURATION -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="coupons"><span class="snum">9.</span> Coupon Configuration</h2>
|
|
|
|
<p>Campaigns can auto-generate unique WooCommerce coupons for discount-based interventions. Configure the coupon in the campaign editor under <strong>Coupon Settings</strong>.</p>
|
|
|
|
<table>
|
|
<tr><th>Field</th><th>Description</th></tr>
|
|
<tr><td>Discount Type</td><td><code>percent</code> (percentage off), <code>fixed</code> (fixed amount off), or <code>free_shipping</code>.</td></tr>
|
|
<tr><td>Amount</td><td>Discount value (e.g., 10 for 10% or $10).</td></tr>
|
|
<tr><td>Prefix</td><td>Coupon code prefix (e.g., <code>FLASH</code> produces <code>FLASH-A1B2C3</code>).</td></tr>
|
|
<tr><td>Expiry (hours)</td><td>Hours until the coupon expires after creation (1–168). Default: 24.</td></tr>
|
|
</table>
|
|
|
|
<h3>How It Works</h3>
|
|
<ol>
|
|
<li>When an intervention is shown, the plugin creates a unique WooCommerce coupon with the configured discount type, amount, and expiry.</li>
|
|
<li>The coupon code is injected into the intervention via the <code>{coupon_code}</code> merge tag or the CTA “Apply Coupon” action.</li>
|
|
<li>The coupon is a standard WooCommerce coupon — it appears in <strong>Marketing → Coupons</strong> and works with all WooCommerce checkout flows.</li>
|
|
<li>Expired coupons are automatically cleaned up by a daily cron job (<code>earlybirds_cp_cleanup_coupons</code>).</li>
|
|
</ol>
|
|
|
|
<div class="info"><strong>Existing Coupons:</strong> You can also reference an existing WooCommerce coupon code in your static template text instead of using auto-generation.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 10. LIVE CAMPAIGN PREVIEW -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="live-preview"><span class="snum">10.</span> Live Campaign Preview</h2>
|
|
|
|
<p>The campaign editor includes a real-time preview panel on the right side. It uses the same CSS and HTML as the storefront, scaled to 65% for a desktop-like viewport.</p>
|
|
|
|
<h3>What Updates Live</h3>
|
|
<ul>
|
|
<li>Headline, body, and CTA text</li>
|
|
<li>Intervention type (popup, slide-in, bar, fullscreen, spin wheel)</li>
|
|
<li>Theme (light, dark, brand)</li>
|
|
<li>Accent color</li>
|
|
<li>Animation style</li>
|
|
<li>Spin wheel slice configuration</li>
|
|
</ul>
|
|
|
|
<h3>Supported Template Types</h3>
|
|
<p>All 7 template types are supported in the preview. The spin wheel shows a mini conic-gradient preview that updates as you add/remove slices or change colors.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 11. CAMPAIGN SCHEDULING -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="scheduling"><span class="snum">11.</span> Campaign Scheduling</h2>
|
|
|
|
<p>Campaigns can be scheduled to run during specific time periods. Configure scheduling in the campaign editor under <strong>Schedule</strong>.</p>
|
|
|
|
<table>
|
|
<tr><th>Field</th><th>Description</th></tr>
|
|
<tr><td>Start Date</td><td>Campaign becomes eligible to fire on this date (inclusive). Leave blank for “immediately”.</td></tr>
|
|
<tr><td>End Date</td><td>Campaign stops firing after this date. Leave blank for “indefinitely”.</td></tr>
|
|
<tr><td>Day of Week</td><td>Array of days (Mon–Sun) when the campaign is active. Leave empty for all days.</td></tr>
|
|
<tr><td>Time Window</td><td>Start and end time (HH:MM, 24-hour) within each active day. Leave blank for all-day.</td></tr>
|
|
</table>
|
|
|
|
<p>Campaigns outside their scheduled window are silently skipped without changing their status. An hourly cron job (<code>earlybirds_cp_process_schedules</code>) evaluates schedule rules.</p>
|
|
|
|
<div class="tip"><strong>Tip:</strong> Combine scheduling with seasonal campaigns — e.g., a Black Friday campaign active only Nov 24–30, or a weekend-only flash sale.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 12. CAMPAIGN IMPORT / EXPORT -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="import-export"><span class="snum">12.</span> Campaign Import / Export</h2>
|
|
|
|
<h3>Exporting</h3>
|
|
<p>From the campaign list, click <strong>Export Campaigns</strong>. This downloads a JSON file containing all campaigns with IDs stripped and statuses set to <code>draft</code>. The file is portable and can be imported on any CartPulse AI installation.</p>
|
|
|
|
<h3>Importing</h3>
|
|
<ol>
|
|
<li>Click <strong>Import Campaigns</strong> on the campaign list page.</li>
|
|
<li>Select a JSON file previously exported from CartPulse AI.</li>
|
|
<li>The plugin validates the file structure and creates all campaigns as <strong>drafts</strong>.</li>
|
|
<li>Review and activate imported campaigns individually.</li>
|
|
</ol>
|
|
|
|
<div class="note"><strong>Note:</strong> Coupon configurations are imported but coupons are not created until the campaign fires. A/B test stats are not imported.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 13. PRESET LIBRARY -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="presets"><span class="snum">13.</span> Preset Library</h2>
|
|
|
|
<p>CartPulse AI includes 12 ready-made campaign presets covering the most common abandonment recovery scenarios. Access them from <strong>Campaigns → Presets</strong>.</p>
|
|
|
|
<table class="compact-table">
|
|
<tr><th>#</th><th>Preset Name</th><th>Category</th><th>Trigger</th><th>Type</th><th>Description</th></tr>
|
|
<tr><td>1</td><td>Flash Urgency Countdown</td><td>Urgency</td><td>Exit Intent</td><td>Popup</td><td>Countdown timer popup with 10% coupon on exit intent.</td></tr>
|
|
<tr><td>2</td><td>Free Shipping Nudge</td><td>Free Shipping</td><td>Cart Value</td><td>Top Bar</td><td>Shows how close the visitor is to free shipping.</td></tr>
|
|
<tr><td>3</td><td>Social Proof Trust Boost</td><td>Social Proof</td><td>Idle Timeout</td><td>Slide-in</td><td>Recent purchase activity slide-in after 30s idle.</td></tr>
|
|
<tr><td>4</td><td>Personalized Discount Offer</td><td>Discounts</td><td>Exit Intent</td><td>Popup</td><td>AI-generated personalized discount with 10% coupon.</td></tr>
|
|
<tr><td>5</td><td>Return Policy Reassurance</td><td>Recovery</td><td>Checkout Abandon</td><td>Popup</td><td>Addresses objections with policy reassurance.</td></tr>
|
|
<tr><td>6</td><td>Cart Value Reminder</td><td>Urgency</td><td>Scroll Depth</td><td>Slide-in</td><td>Reminds visitors of items in cart at 60% scroll.</td></tr>
|
|
<tr><td>7</td><td>Mobile Quick Exit</td><td>Urgency</td><td>Exit Intent</td><td>Popup</td><td>Lightweight popup optimized for mobile exit.</td></tr>
|
|
<tr><td>8</td><td>High-Value Cart VIP Offer</td><td>Discounts</td><td>Cart Value</td><td>Fullscreen</td><td>AI-generated VIP discount for carts over $100.</td></tr>
|
|
<tr><td>9</td><td>Sticky Discount Bar</td><td>Discounts</td><td>Exit Intent</td><td>Bottom Bar</td><td>Persistent discount code in bottom bar (desktop).</td></tr>
|
|
<tr><td>10</td><td>Testimonial Trust Popup</td><td>Social Proof</td><td>Tab Switch</td><td>Popup</td><td>Customer testimonial shown when tab switching.</td></tr>
|
|
<tr><td>11</td><td>Checkout Recovery Offer</td><td>Recovery</td><td>Checkout Abandon</td><td>Popup</td><td>AI-generated 15% discount for checkout abandoners.</td></tr>
|
|
<tr><td>12</td><td>Spin to Win</td><td>Gamification</td><td>Exit Intent</td><td>Spin Wheel</td><td>Interactive spinning wheel with configurable prizes.</td></tr>
|
|
</table>
|
|
|
|
<p>Presets are created as <strong>draft</strong> campaigns. Review the configuration and activate when ready.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 14. A/B TESTING -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="ab-testing"><span class="snum">14.</span> A/B Testing</h2>
|
|
|
|
<h3>Creating an A/B Test</h3>
|
|
<ol>
|
|
<li>Open an existing campaign or create a new one.</li>
|
|
<li>Click <strong>Add Variant</strong> in the campaign editor.</li>
|
|
<li>Configure Variant B’s headline, body, CTA, coupon, and design independently from the control (Variant A).</li>
|
|
<li>Set the <strong>Split Ratio</strong> (e.g., 50/50 or 70/30) — this determines what percentage of qualifying sessions see each variant.</li>
|
|
<li>Save and activate the campaign.</li>
|
|
</ol>
|
|
|
|
<h3>How Visitors Are Assigned</h3>
|
|
<p>Assignment is <strong>deterministic</strong> — based on a hash of the session ID and campaign ID. This ensures the same visitor always sees the same variant, even across page loads.</p>
|
|
|
|
<h3>Reading A/B Results</h3>
|
|
<p>In the campaign editor, a results comparison card shows side-by-side stats for each variant:</p>
|
|
<table>
|
|
<tr><th>Metric</th><th>Description</th></tr>
|
|
<tr><td>Impressions</td><td>Number of times this variant was shown.</td></tr>
|
|
<tr><td>Clicks</td><td>CTA button clicks.</td></tr>
|
|
<tr><td>Conversions</td><td>Sessions that purchased after seeing this variant.</td></tr>
|
|
<tr><td>Conversion Rate</td><td>Conversions / Impressions as a percentage.</td></tr>
|
|
<tr><td>Revenue</td><td>Total order value from converting sessions.</td></tr>
|
|
<tr><td>Confidence</td><td>Statistical significance level (shown when sample size is sufficient).</td></tr>
|
|
</table>
|
|
|
|
<h3>Auto-Winner Detection</h3>
|
|
<p>When a variant reaches the configured statistical confidence threshold and minimum sample size, the system declares it the winner. Optionally, the losing variant is deactivated automatically.</p>
|
|
|
|
<div class="tip"><strong>Tip:</strong> Run each variant for at least 7 days before drawing conclusions. Low-traffic stores may need 2–4 weeks for reliable results.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 15. SPIN-TO-WIN WHEEL -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="spin-wheel"><span class="snum">15.</span> Spin-to-Win Wheel</h2>
|
|
|
|
<p>The spin-to-win wheel is a gamified intervention that can increase engagement compared to standard popups. Visitors spin the wheel to win a discount or prize.</p>
|
|
|
|
<h3>Configuration</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Description</th></tr>
|
|
<tr><td>Slices</td><td>3 to 8 slices. Each slice has its own label, color, discount type, amount, and probability weight.</td></tr>
|
|
<tr><td>Label</td><td>Text shown on the slice (e.g., “10% Off”, “Free Shipping”, “Try Again”).</td></tr>
|
|
<tr><td>Color</td><td>Background color for the slice (hex value).</td></tr>
|
|
<tr><td>Discount Type</td><td><code>percent</code>, <code>fixed</code>, <code>free_shipping</code>, or <code>none</code> (for “Try Again” slices).</td></tr>
|
|
<tr><td>Discount Amount</td><td>Value of the discount (e.g., 10 for 10%).</td></tr>
|
|
<tr><td>Probability Weight</td><td>Relative likelihood of landing on this slice. Weights are auto-normalized to 100%.</td></tr>
|
|
</table>
|
|
|
|
<h3>How It Works</h3>
|
|
<ol>
|
|
<li>Visitor clicks the CTA button (“Spin Now”).</li>
|
|
<li>The server determines the winning slice based on probability weights.</li>
|
|
<li>The wheel animates to land on the winning slice.</li>
|
|
<li>If the winning slice has a discount, a WooCommerce coupon is generated and displayed to the visitor.</li>
|
|
<li>The visitor can copy the code or click “Apply” to add it to their cart.</li>
|
|
</ol>
|
|
|
|
<h3>Preview</h3>
|
|
<p>A mini conic-gradient preview updates in real time in the campaign editor as you add, remove, or modify slices.</p>
|
|
|
|
<div class="note"><strong>Note:</strong> Each visitor can only spin once per session (rate-limited server-side). The “Try Again” slice type does not generate a coupon.</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 16. ANALYTICS DASHBOARD -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="analytics"><span class="snum">16.</span> Analytics Dashboard</h2>
|
|
|
|
<p>The analytics dashboard (<strong>CartPulse AI → Analytics</strong>) provides detailed performance metrics with interactive Chart.js-powered visualizations.</p>
|
|
|
|
<h3>Charts</h3>
|
|
<table>
|
|
<tr><th>Chart</th><th>Type</th><th>Description</th></tr>
|
|
<tr><td>Revenue Saved</td><td>Line chart (filled area)</td><td>Revenue saved over time. Hover for daily amounts.</td></tr>
|
|
<tr><td>Interventions vs Conversions</td><td>Bar chart</td><td>Side-by-side bars per day: interventions shown (indigo) vs converted (green).</td></tr>
|
|
<tr><td>Conversions by Strategy</td><td>Donut chart</td><td>Which intervention strategies drive the most conversions.</td></tr>
|
|
<tr><td>Checkout Funnel</td><td>Horizontal bar</td><td>Visit → Cart → Checkout → Payment → Order with percentage at each stage.</td></tr>
|
|
</table>
|
|
|
|
<h3>Summary Metrics</h3>
|
|
<ul>
|
|
<li><strong>Sessions</strong> — Unique visitor sessions tracked.</li>
|
|
<li><strong>Interventions Shown</strong> — How many sessions triggered a campaign.</li>
|
|
<li><strong>Conversions</strong> — Sessions that purchased after seeing an intervention.</li>
|
|
<li><strong>Attributed Revenue</strong> — Order revenue linked to intervention sessions.</li>
|
|
<li><strong>Conversion Rate</strong> — Conversions / Interventions Shown.</li>
|
|
<li><strong>ROI Calculator</strong> — Attributed revenue vs. estimated AI API cost.</li>
|
|
</ul>
|
|
|
|
<h3>Campaign Performance</h3>
|
|
<p>Below the charts, a table breaks down performance per campaign with columns for impressions, clicks, conversions, conversion rate, and revenue attributed. A/B test variants appear as sub-rows.</p>
|
|
|
|
<h3>Intent Distribution</h3>
|
|
<p>A histogram showing the distribution of visitor intent scores (0–100) helps you understand your traffic’s engagement level.</p>
|
|
|
|
<h3>Date Range & Export</h3>
|
|
<ul>
|
|
<li><strong>Date Range Picker</strong> — Filter by 7-day, 30-day, or 90-day periods.</li>
|
|
<li><strong>Export CSV</strong> — Download a spreadsheet with daily breakdowns and summary totals.</li>
|
|
</ul>
|
|
|
|
<h3>Email Digests</h3>
|
|
<p>Enable <strong>Weekly Digest</strong> under Settings to receive a summary email every Monday with the previous week’s key metrics. Revenue milestone alerts can also be configured.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 17. LIVE VISITORS DASHBOARD -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="live-visitors"><span class="snum">17.</span> Live Visitors Dashboard</h2>
|
|
|
|
<p>The live visitors page (<strong>CartPulse AI → Live Visitors</strong>) shows a real-time view of active visitors on your store.</p>
|
|
|
|
<h3>Per-Visitor Data</h3>
|
|
<table>
|
|
<tr><th>Column</th><th>Description</th></tr>
|
|
<tr><td>Session ID</td><td>Anonymous session identifier (truncated for display).</td></tr>
|
|
<tr><td>Page</td><td>Current page the visitor is viewing.</td></tr>
|
|
<tr><td>Page Type</td><td>Product, cart, checkout, category, shop, or other.</td></tr>
|
|
<tr><td>Intent Score</td><td>Real-time purchase intent score (0–100) with a progress bar.</td></tr>
|
|
<tr><td>Cart Value</td><td>Current cart total in store currency.</td></tr>
|
|
<tr><td>Device</td><td>Desktop or Mobile.</td></tr>
|
|
<tr><td>Duration</td><td>Time since session started.</td></tr>
|
|
<tr><td>Status</td><td>Hot (intent ≥ 60), Warm (intent 30–59), or Browsing (intent < 30).</td></tr>
|
|
</table>
|
|
|
|
<h3>Auto-Refresh</h3>
|
|
<p>The dashboard auto-refreshes every 15 seconds via the REST API. No manual refresh is needed.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 18. CART RECOVERY EMAILS -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="cart-recovery"><span class="snum">18.</span> Cart Recovery Emails</h2>
|
|
|
|
<p>CartPulse AI can send automated recovery emails to visitors who abandon their carts. This feature works alongside real-time interventions to recover sales even after the visitor has left.</p>
|
|
|
|
<h3>Settings</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Description</th></tr>
|
|
<tr><td>Enabled</td><td>Toggle cart recovery emails on/off.</td></tr>
|
|
<tr><td>Delay (minutes)</td><td>How long to wait after cart abandonment before sending the email (default: 60).</td></tr>
|
|
<tr><td>Coupon Enabled</td><td>Include an auto-generated discount coupon in the recovery email.</td></tr>
|
|
<tr><td>Coupon Type</td><td>Percent or fixed discount.</td></tr>
|
|
<tr><td>Coupon Amount</td><td>Discount value for the recovery coupon.</td></tr>
|
|
<tr><td>Email Subject</td><td>Custom subject line for the recovery email.</td></tr>
|
|
</table>
|
|
|
|
<h3>How It Works</h3>
|
|
<ol>
|
|
<li>When a session with items in the cart expires without a purchase, a recovery record is created.</li>
|
|
<li>An hourly cron job checks for pending recovery records that have passed the delay threshold.</li>
|
|
<li>The recovery email is sent with a unique recovery link (<code>?cp_recover=TOKEN</code>).</li>
|
|
<li>Clicking the link restores the visitor’s cart and redirects them to the cart page.</li>
|
|
<li>Old recovery records (7+ days) are automatically expired and cleaned up.</li>
|
|
</ol>
|
|
|
|
<div class="note"><strong>Note:</strong> Cart recovery emails require the visitor to have provided their email address (e.g., at checkout or via an email capture intervention).</div>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 19. COMPLETE SETTINGS REFERENCE -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="settings-ref"><span class="snum">19.</span> Complete Settings Reference</h2>
|
|
|
|
<p>All settings are under <strong>CartPulse AI → Settings</strong>.</p>
|
|
|
|
<h3>General</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>Enabled</td><td>Yes</td><td>Master switch for all tracking and interventions.</td></tr>
|
|
<tr><td>Debug Mode</td><td>No</td><td>Enables verbose logging to WooCommerce → Status → Logs. Disable in production.</td></tr>
|
|
</table>
|
|
|
|
<h3>AI Configuration</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>AI Provider</td><td>(none)</td><td>OpenAI or Anthropic. Leave blank to use static templates only.</td></tr>
|
|
<tr><td>OpenAI API Key</td><td>—</td><td>Encrypted at rest using libsodium. Never displayed after saving.</td></tr>
|
|
<tr><td>Anthropic API Key</td><td>—</td><td>Encrypted at rest using libsodium. Never displayed after saving.</td></tr>
|
|
<tr><td>Model</td><td>(auto)</td><td>Model for AI content generation (e.g., gpt-4o, claude-3-haiku).</td></tr>
|
|
<tr><td>Monthly Budget (USD)</td><td>$50.00</td><td>Hard cap on AI API spending. Range: $0–$10,000.</td></tr>
|
|
<tr><td>Default Tone</td><td>Friendly</td><td>Friendly, Professional, Urgent, or Casual. Overridable per campaign.</td></tr>
|
|
<tr><td>Default Language</td><td>English</td><td>Language for AI-generated text. Overridable per campaign.</td></tr>
|
|
</table>
|
|
|
|
<h4>Obtaining an API Key</h4>
|
|
<table>
|
|
<tr><th>Provider</th><th>Where to Get a Key</th></tr>
|
|
<tr><td>OpenAI</td><td>platform.openai.com → API Keys → Create new secret key</td></tr>
|
|
<tr><td>Anthropic</td><td>console.anthropic.com → API Keys → Create Key</td></tr>
|
|
</table>
|
|
|
|
<h3>Behavior Tracking</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>Session Timeout (minutes)</td><td>30</td><td>Minutes of inactivity before a session expires. Range: 1–1440.</td></tr>
|
|
<tr><td>Batch Interval (ms)</td><td>5000</td><td>How often the storefront sends behavior events to the server. Range: 1000–60000.</td></tr>
|
|
<tr><td>Max Interventions per Session</td><td>2</td><td>Maximum number of interventions shown in one session. Range: 1–10.</td></tr>
|
|
<tr><td>Intervention Cooldown (seconds)</td><td>60</td><td>Minimum time between showing two interventions. Range: 0–3600.</td></tr>
|
|
<tr><td>Intent Weights</td><td>(defaults)</td><td>Custom weights for the 12 intent scoring signals. Auto-normalizes to 100.</td></tr>
|
|
</table>
|
|
|
|
<h3>Privacy</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>Cookie Consent</td><td>Auto-detect</td><td><strong>Auto-detect</strong>: checks for CookieYes, Complianz, Cookie Notice (dFactory), Borlabs Cookie, CookieBot, WP Consent API. <strong>WP Consent API</strong>: uses only the WP Consent API standard. <strong>None</strong>: always track (not recommended in EU).</td></tr>
|
|
<tr><td>Consent Category</td><td>Statistics</td><td>Which consent category must be accepted: Statistics or Marketing.</td></tr>
|
|
<tr><td>Respect Do Not Track</td><td>Yes</td><td>Honor the browser DNT header.</td></tr>
|
|
<tr><td>Data Retention (days)</td><td>30</td><td>Days to keep behavior events and session data. Range: 1–365. A daily cron purges older records.</td></tr>
|
|
<tr><td>Delete Data on Uninstall</td><td>No</td><td>When enabled, all plugin tables and options are removed on plugin deletion.</td></tr>
|
|
</table>
|
|
|
|
<h3>Store Context</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>Free Shipping Threshold</td><td>0</td><td>Cart value required for free shipping. Used by the <code>{shipping_gap}</code> and <code>{shipping_threshold}</code> merge tags.</td></tr>
|
|
<tr><td>Return Policy</td><td>(blank)</td><td>Summary of your return policy. Provided to AI for objection handling prompts.</td></tr>
|
|
<tr><td>Shipping Policy</td><td>(blank)</td><td>Summary of your shipping policy. Provided to AI prompts.</td></tr>
|
|
<tr><td>Guarantees</td><td>(blank)</td><td>Satisfaction guarantees. Provided to AI prompts.</td></tr>
|
|
</table>
|
|
|
|
<h3>Notifications</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>Weekly Digest</td><td>Off</td><td>Send a weekly performance summary email every Monday.</td></tr>
|
|
<tr><td>Digest Recipients</td><td>Admin email</td><td>Comma-separated email addresses for the digest.</td></tr>
|
|
<tr><td>Revenue Milestone Alerts</td><td>On</td><td>Notify when revenue saved reaches significant milestones.</td></tr>
|
|
</table>
|
|
|
|
<h3>Integrations</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>GA4 Measurement ID</td><td>(blank)</td><td>Google Analytics 4 measurement ID (<code>G-XXXXXXXXXX</code>) for event tracking.</td></tr>
|
|
<tr><td>Webhook URL</td><td>(blank)</td><td>Endpoint URL for webhook delivery.</td></tr>
|
|
<tr><td>Webhook Secret</td><td>(blank)</td><td>Shared secret for HMAC-SHA256 signature verification.</td></tr>
|
|
<tr><td>Webhook Events</td><td>intervention.shown, intervention.converted, order.attributed</td><td>Events that trigger webhook delivery.</td></tr>
|
|
</table>
|
|
|
|
<h3>Excluded Roles & Pages</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>Excluded Roles</td><td>Administrator, Shop Manager</td><td>These roles never see interventions or get tracked (unless Preview Mode is on).</td></tr>
|
|
<tr><td>Excluded Pages</td><td>(none)</td><td>Specific page IDs or slugs to skip.</td></tr>
|
|
<tr><td>Trusted Proxy IPs</td><td>(none)</td><td>If behind a load balancer, list proxy IPs so rate limiting uses the real client IP.</td></tr>
|
|
</table>
|
|
|
|
<h3>License</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Description</th></tr>
|
|
<tr><td>Purchase Code</td><td>Your CodeCanyon/Envato purchase code (UUID). Used to verify your purchase for updates and support.</td></tr>
|
|
<tr><td>Verification Status</td><td>Verified, Unverified, or Invalid. Checked periodically against the Envato API.</td></tr>
|
|
</table>
|
|
|
|
<h3>Cart Recovery</h3>
|
|
<table>
|
|
<tr><th>Setting</th><th>Default</th><th>Description</th></tr>
|
|
<tr><td>Enable Cart Recovery</td><td>Off</td><td>Toggle automated cart recovery emails.</td></tr>
|
|
<tr><td>Delay (minutes)</td><td>60</td><td>Wait time before sending recovery email.</td></tr>
|
|
<tr><td>Recovery Coupon</td><td>Off</td><td>Include an auto-generated coupon in the email.</td></tr>
|
|
<tr><td>Coupon Type</td><td>Percent</td><td>Percentage or fixed amount discount.</td></tr>
|
|
<tr><td>Coupon Amount</td><td>10</td><td>Discount value.</td></tr>
|
|
<tr><td>Email Subject</td><td>(default)</td><td>Custom subject line for recovery emails.</td></tr>
|
|
</table>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 20. TOOLS & DIAGNOSTICS -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="tools"><span class="snum">20.</span> Tools & Diagnostics</h2>
|
|
|
|
<p>The Tools page (<strong>CartPulse AI → Tools</strong>) provides system diagnostics, maintenance actions, a log viewer, and a support bundle generator.</p>
|
|
|
|
<h3>System Status Checks</h3>
|
|
<p>A comprehensive status table displays 15+ environment checks:</p>
|
|
<table class="compact-table">
|
|
<tr><th>Check</th><th>What It Verifies</th></tr>
|
|
<tr><td>PHP Version</td><td>PHP ≥ 7.4</td></tr>
|
|
<tr><td>WordPress Version</td><td>WP version reported</td></tr>
|
|
<tr><td>WooCommerce Version</td><td>WC is active and version</td></tr>
|
|
<tr><td>MySQL Version</td><td>Database server version</td></tr>
|
|
<tr><td>Memory Limit</td><td>≥ 128 MB recommended</td></tr>
|
|
<tr><td>Max Execution Time</td><td>PHP max_execution_time</td></tr>
|
|
<tr><td>libsodium</td><td>sodium extension available for encryption</td></tr>
|
|
<tr><td>REST API</td><td>WordPress REST API is reachable</td></tr>
|
|
<tr><td>WP-Cron</td><td>Not disabled by DISABLE_WP_CRON</td></tr>
|
|
<tr><td>AI Configured</td><td>At least one API key is set</td></tr>
|
|
<tr><td>Active Campaigns</td><td>Number of active campaigns</td></tr>
|
|
<tr><td>DB Tables (5+)</td><td>Each plugin table exists</td></tr>
|
|
<tr><td>Cron Events (5)</td><td>Each cron hook is scheduled with next run time</td></tr>
|
|
</table>
|
|
<p>Click <strong>Copy to Clipboard</strong> to copy the full status as JSON for support requests.</p>
|
|
|
|
<h3>Maintenance Tools</h3>
|
|
<table>
|
|
<tr><th>Tool</th><th>Description</th><th>Confirmation Required</th></tr>
|
|
<tr><td>Flush Cache</td><td>Clear all plugin cache entries.</td><td>No</td></tr>
|
|
<tr><td>Run Migrations</td><td>Re-run database migrations (safe to run multiple times).</td><td>No</td></tr>
|
|
<tr><td>Clear Sessions</td><td>Truncate the sessions table.</td><td>Yes</td></tr>
|
|
<tr><td>Clear Behavior Events</td><td>Truncate the behavior events table.</td><td>Yes</td></tr>
|
|
<tr><td>Clear Token Usage</td><td>Reset AI token usage tracking.</td><td>Yes</td></tr>
|
|
<tr><td>Regenerate Webhook Secret</td><td>Generate a new random webhook signing secret.</td><td>Yes</td></tr>
|
|
<tr><td>Clear Demo Data</td><td>Remove all imported demo campaigns and analytics.</td><td>Yes</td></tr>
|
|
</table>
|
|
|
|
<h3>Log Viewer</h3>
|
|
<p>View the last 200 lines of the plugin log file (stored in WooCommerce’s log directory). Filter by level: All, Error, Warning, Info, or Debug. Download the full log or clear it.</p>
|
|
|
|
<h3>Support Bundle</h3>
|
|
<p>Click <strong>Generate Support Bundle</strong> to download a ZIP containing:</p>
|
|
<ul>
|
|
<li><code>system-status.json</code> — Full system status checks.</li>
|
|
<li><code>settings.json</code> — Plugin settings (<strong>API keys are redacted</strong>).</li>
|
|
<li><code>campaigns.json</code> — All campaign configurations.</li>
|
|
<li><code>cp-log.txt</code> — Last 500 log lines.</li>
|
|
</ul>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 21. REST API REFERENCE -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="rest-api"><span class="snum">21.</span> REST API Reference</h2>
|
|
|
|
<p>CartPulse AI exposes a comprehensive REST API under the namespace <code>earlybirds-cp/v1</code>. All admin endpoints require authentication via cookie+nonce or application password with <code>manage_woocommerce</code> capability.</p>
|
|
|
|
<div class="info"><strong>Base URL:</strong> <code>https://yoursite.com/wp-json/earlybirds-cp/v1/</code></div>
|
|
|
|
<h3>Campaigns</h3>
|
|
<table class="compact-table">
|
|
<tr><th>Method</th><th>Endpoint</th><th>Description</th></tr>
|
|
<tr><td>GET</td><td><code>/campaigns</code></td><td>List all campaigns (supports status filter, pagination).</td></tr>
|
|
<tr><td>POST</td><td><code>/campaigns</code></td><td>Create a new campaign.</td></tr>
|
|
<tr><td>GET</td><td><code>/campaigns/{id}</code></td><td>Get a single campaign by ID.</td></tr>
|
|
<tr><td>PUT</td><td><code>/campaigns/{id}</code></td><td>Update a campaign.</td></tr>
|
|
<tr><td>DELETE</td><td><code>/campaigns/{id}</code></td><td>Delete a campaign.</td></tr>
|
|
<tr><td>POST</td><td><code>/campaigns/import</code></td><td>Import campaigns from JSON.</td></tr>
|
|
<tr><td>GET</td><td><code>/campaigns/export</code></td><td>Export all campaigns as JSON.</td></tr>
|
|
</table>
|
|
|
|
<h3>Analytics</h3>
|
|
<table class="compact-table">
|
|
<tr><th>Method</th><th>Endpoint</th><th>Description</th></tr>
|
|
<tr><td>GET</td><td><code>/analytics/summary</code></td><td>Summary metrics for a date range.</td></tr>
|
|
<tr><td>GET</td><td><code>/analytics/daily</code></td><td>Daily breakdown of metrics.</td></tr>
|
|
<tr><td>GET</td><td><code>/analytics/campaigns</code></td><td>Per-campaign performance breakdown.</td></tr>
|
|
<tr><td>GET</td><td><code>/analytics/funnel</code></td><td>Checkout funnel data.</td></tr>
|
|
<tr><td>GET</td><td><code>/analytics/strategies</code></td><td>Conversions by intervention strategy.</td></tr>
|
|
<tr><td>GET</td><td><code>/analytics/intent-distribution</code></td><td>Intent score histogram.</td></tr>
|
|
<tr><td>GET</td><td><code>/analytics/export</code></td><td>CSV download of analytics data.</td></tr>
|
|
</table>
|
|
|
|
<h3>Behavior (Public)</h3>
|
|
<table class="compact-table">
|
|
<tr><th>Method</th><th>Endpoint</th><th>Auth</th><th>Description</th></tr>
|
|
<tr><td>POST</td><td><code>/behavior/session</code></td><td>Nonce</td><td>Create or resume a visitor session.</td></tr>
|
|
<tr><td>POST</td><td><code>/behavior/events</code></td><td>Nonce</td><td>Batch-submit behavior events.</td></tr>
|
|
<tr><td>POST</td><td><code>/behavior/heartbeat</code></td><td>Nonce</td><td>Keep session alive.</td></tr>
|
|
</table>
|
|
|
|
<h3>Interventions</h3>
|
|
<table class="compact-table">
|
|
<tr><th>Method</th><th>Endpoint</th><th>Description</th></tr>
|
|
<tr><td>POST</td><td><code>/interventions/evaluate</code></td><td>Evaluate campaigns and return matching intervention.</td></tr>
|
|
<tr><td>POST</td><td><code>/interventions/shown</code></td><td>Log an intervention impression.</td></tr>
|
|
<tr><td>POST</td><td><code>/interventions/dismissed</code></td><td>Log an intervention dismissal.</td></tr>
|
|
<tr><td>POST</td><td><code>/interventions/clicked</code></td><td>Log a CTA click.</td></tr>
|
|
<tr><td>POST</td><td><code>/interventions/spin</code></td><td>Execute a spin-to-win wheel spin.</td></tr>
|
|
</table>
|
|
|
|
<h3>Settings (Admin)</h3>
|
|
<table class="compact-table">
|
|
<tr><th>Method</th><th>Endpoint</th><th>Description</th></tr>
|
|
<tr><td>GET</td><td><code>/settings</code></td><td>Get all settings (API keys masked).</td></tr>
|
|
<tr><td>PUT</td><td><code>/settings</code></td><td>Update settings (partial update supported).</td></tr>
|
|
<tr><td>POST</td><td><code>/settings/test-connection</code></td><td>Test AI provider connection.</td></tr>
|
|
<tr><td>GET</td><td><code>/system/status</code></td><td>Structured system health checks.</td></tr>
|
|
</table>
|
|
|
|
<h3>Live Visitors (Admin)</h3>
|
|
<table class="compact-table">
|
|
<tr><th>Method</th><th>Endpoint</th><th>Description</th></tr>
|
|
<tr><td>GET</td><td><code>/live-visitors</code></td><td>Active sessions with intent scores, cart values, and page info.</td></tr>
|
|
</table>
|
|
|
|
<h3>Cart Recovery (Admin)</h3>
|
|
<table class="compact-table">
|
|
<tr><th>Method</th><th>Endpoint</th><th>Description</th></tr>
|
|
<tr><td>GET</td><td><code>/cart-recovery</code></td><td>List pending and sent recovery records.</td></tr>
|
|
<tr><td>DELETE</td><td><code>/cart-recovery/{id}</code></td><td>Delete a recovery record.</td></tr>
|
|
</table>
|
|
|
|
<h3>Rate Limiting</h3>
|
|
<p>All endpoints are rate-limited: <strong>60 requests/minute</strong> for general endpoints, <strong>10 requests/minute</strong> for AI-related endpoints. Rate limit headers (<code>X-RateLimit-Limit</code>, <code>X-RateLimit-Remaining</code>) are included in responses.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 22. WEBHOOKS -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="webhooks"><span class="snum">22.</span> Webhooks</h2>
|
|
|
|
<p>Webhooks push real-time events to external systems such as Zapier, Make, or custom endpoints.</p>
|
|
|
|
<h3>Supported Events</h3>
|
|
<table>
|
|
<tr><th>Event</th><th>When Fired</th></tr>
|
|
<tr><td><code>intervention.shown</code></td><td>An intervention was displayed to a visitor.</td></tr>
|
|
<tr><td><code>intervention.converted</code></td><td>A visitor who saw an intervention completed a purchase.</td></tr>
|
|
<tr><td><code>order.attributed</code></td><td>An order was attributed to a CartPulse AI session.</td></tr>
|
|
<tr><td><code>campaign.updated</code></td><td>A campaign was created, updated, or status changed.</td></tr>
|
|
</table>
|
|
|
|
<h3>Payload Format</h3>
|
|
<pre><code>{
|
|
"event": "intervention.shown",
|
|
"timestamp": "2026-02-18T14:30:00Z",
|
|
"plugin_version": "1.0.0",
|
|
"data": {
|
|
"session_id": "abc123",
|
|
"campaign_id": 42,
|
|
"variant_id": 1,
|
|
"cart_value": "59.99"
|
|
}
|
|
}</code></pre>
|
|
|
|
<h3>HMAC-SHA256 Signature Verification</h3>
|
|
<p>When a Webhook Secret is configured, every request includes an <code>X-CartPulse-Signature</code> header containing an HMAC-SHA256 hash of the raw request body.</p>
|
|
|
|
<h4>PHP Verification Example</h4>
|
|
<pre><code>$body = file_get_contents('php://input');
|
|
$signature = $_SERVER['HTTP_X_CARTPULSE_SIGNATURE'] ?? '';
|
|
$expected = hash_hmac('sha256', $body, YOUR_SECRET_KEY);
|
|
|
|
if ( ! hash_equals($expected, $signature) ) {
|
|
http_response_code(401);
|
|
exit('Invalid signature');
|
|
}</code></pre>
|
|
|
|
<h3>Security</h3>
|
|
<ul>
|
|
<li>Webhook URLs are validated to prevent SSRF — only public HTTP/HTTPS URLs are allowed.</li>
|
|
<li>Private/reserved IP ranges (127.x, 10.x, 192.168.x, etc.) are blocked.</li>
|
|
<li>Delivery timeout is 10 seconds.</li>
|
|
</ul>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 23. WP-CLI COMMANDS -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="wp-cli"><span class="snum">23.</span> WP-CLI Commands</h2>
|
|
|
|
<p>CartPulse AI registers WP-CLI commands under the <code>wp earlybirds</code> namespace.</p>
|
|
|
|
<pre><code># Run database migrations (safe to run multiple times)
|
|
wp earlybirds migrate
|
|
|
|
# Flush all plugin cache entries
|
|
wp earlybirds cache:flush
|
|
|
|
# Show plugin status (version, DB version, license, AI provider)
|
|
wp earlybirds status
|
|
|
|
# Export all settings to a JSON file
|
|
wp earlybirds settings:export --file=/path/to/settings.json
|
|
|
|
# Import settings from a JSON file
|
|
wp earlybirds settings:import --file=/path/to/settings.json</code></pre>
|
|
|
|
<table>
|
|
<tr><th>Command</th><th>Description</th></tr>
|
|
<tr><td><code>wp earlybirds migrate</code></td><td>Create or upgrade plugin database tables to the current schema version. Safe to re-run.</td></tr>
|
|
<tr><td><code>wp earlybirds cache:flush</code></td><td>Delete all cached objects created by this plugin (does not affect other WP object cache entries).</td></tr>
|
|
<tr><td><code>wp earlybirds status</code></td><td>Display plugin version, database schema version, license status, AI provider, and rate-limiter stats.</td></tr>
|
|
<tr><td><code>wp earlybirds settings:export</code></td><td>Write current settings to a JSON file. API keys are excluded for security.</td></tr>
|
|
<tr><td><code>wp earlybirds settings:import</code></td><td>Restore settings from a previously exported JSON file. Does not overwrite API keys.</td></tr>
|
|
</table>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 24. HOOKS & FILTERS REFERENCE -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="hooks"><span class="snum">24.</span> Hooks & Filters Reference</h2>
|
|
|
|
<p>CartPulse AI provides action hooks and filters for developers to extend or modify plugin behavior.</p>
|
|
|
|
<h3>Actions</h3>
|
|
<table>
|
|
<tr><th>Hook</th><th>Parameters</th><th>Description</th></tr>
|
|
<tr><td><code>earlybirds_cp_intervention_shown</code></td><td><code>$campaign_id</code>, <code>$session_id</code>, <code>$variant_id</code></td><td>Fired when an intervention is displayed to a visitor.</td></tr>
|
|
<tr><td><code>earlybirds_cp_intervention_converted</code></td><td><code>$campaign_id</code>, <code>$session_id</code>, <code>$order_id</code></td><td>Fired when an intervention session results in a purchase.</td></tr>
|
|
<tr><td><code>earlybirds_cp_campaign_created</code></td><td><code>$campaign_id</code>, <code>$data</code></td><td>Fired after a new campaign is created.</td></tr>
|
|
<tr><td><code>earlybirds_cp_campaign_updated</code></td><td><code>$campaign_id</code>, <code>$data</code></td><td>Fired after a campaign is updated.</td></tr>
|
|
<tr><td><code>earlybirds_cp_coupon_generated</code></td><td><code>$coupon_code</code>, <code>$campaign_id</code></td><td>Fired after an auto-generated coupon is created.</td></tr>
|
|
<tr><td><code>earlybirds_cp_session_started</code></td><td><code>$session_id</code></td><td>Fired when a new tracking session begins.</td></tr>
|
|
</table>
|
|
|
|
<h3>Filters</h3>
|
|
<table>
|
|
<tr><th>Hook</th><th>Parameters</th><th>Return</th><th>Description</th></tr>
|
|
<tr><td><code>earlybirds_cp_storefront_config</code></td><td><code>$config</code></td><td><code>array</code></td><td>Modify the configuration object passed to the storefront JavaScript.</td></tr>
|
|
<tr><td><code>earlybirds_cp_ai_prompt</code></td><td><code>$prompt</code>, <code>$context</code></td><td><code>string</code></td><td>Modify the AI prompt before it is sent to the provider.</td></tr>
|
|
<tr><td><code>earlybirds_cp_intervention_content</code></td><td><code>$content</code>, <code>$campaign</code></td><td><code>array</code></td><td>Modify intervention content (headline, body, CTA) before rendering.</td></tr>
|
|
<tr><td><code>earlybirds_cp_should_track</code></td><td><code>$should_track</code></td><td><code>bool</code></td><td>Override whether the current visitor should be tracked.</td></tr>
|
|
<tr><td><code>earlybirds_cp_coupon_args</code></td><td><code>$args</code>, <code>$campaign</code></td><td><code>array</code></td><td>Modify WooCommerce coupon arguments before creation.</td></tr>
|
|
<tr><td><code>earlybirds_cp_intent_weights</code></td><td><code>$weights</code></td><td><code>array</code></td><td>Modify intent scoring signal weights.</td></tr>
|
|
</table>
|
|
|
|
<h4>Example: Override Tracking for Custom Conditions</h4>
|
|
<pre><code>add_filter( 'earlybirds_cp_should_track', function( $should_track ) {
|
|
// Don't track visitors from internal IP range.
|
|
$ip = $_SERVER['REMOTE_ADDR'] ?? '';
|
|
if ( strpos( $ip, '10.0.' ) === 0 ) {
|
|
return false;
|
|
}
|
|
return $should_track;
|
|
} );</code></pre>
|
|
|
|
<h4>Example: Modify AI Prompt</h4>
|
|
<pre><code>add_filter( 'earlybirds_cp_ai_prompt', function( $prompt, $context ) {
|
|
// Add seasonal context to AI prompts.
|
|
$prompt .= "\nNote: We are currently running a summer sale.";
|
|
return $prompt;
|
|
}, 10, 2 );</code></pre>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 25. PRIVACY & GDPR -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="privacy"><span class="snum">25.</span> Privacy & GDPR</h2>
|
|
|
|
<h3>Data Stored Locally</h3>
|
|
<p>All data collected by CartPulse AI is stored in your WordPress database — no data is sent to Earlybirds servers. The following tables are created:</p>
|
|
<table>
|
|
<tr><th>Table</th><th>Contents</th></tr>
|
|
<tr><td><code>{prefix}cp_sessions</code></td><td>Anonymous session ID, entry time, cart value, device type.</td></tr>
|
|
<tr><td><code>{prefix}cp_behavior_events</code></td><td>Behavior events: page views, scroll depth, idle time, exit signals.</td></tr>
|
|
<tr><td><code>{prefix}cp_intervention_logs</code></td><td>Which campaign/variant was shown, dismissal or conversion outcome.</td></tr>
|
|
<tr><td><code>{prefix}cp_analytics</code></td><td>Aggregated daily metrics per campaign.</td></tr>
|
|
<tr><td><code>{prefix}earlybirds_cp_token_usage</code></td><td>AI API token consumption per request (used for budget tracking).</td></tr>
|
|
<tr><td><code>{prefix}earlybirds_cp_campaigns</code></td><td>Campaign configurations (admin-created data, not visitor data).</td></tr>
|
|
<tr><td><code>{prefix}cp_cart_recovery</code></td><td>Cart recovery records with cart contents and recovery tokens.</td></tr>
|
|
</table>
|
|
|
|
<h3>What Is Sent to AI Providers</h3>
|
|
<p>When AI content is requested for an intervention, the plugin sends a prompt containing:</p>
|
|
<ul>
|
|
<li>Cart item names and quantities (not prices by default)</li>
|
|
<li>Store name and configured tone/language</li>
|
|
<li>Campaign instructions</li>
|
|
</ul>
|
|
<p><strong>Never sent:</strong> Customer names, email addresses, order IDs, payment details, IP addresses, or any PII.</p>
|
|
|
|
<h3>Cookie Consent Integration</h3>
|
|
<p>CartPulse AI auto-detects 6 popular cookie consent plugins:</p>
|
|
<ol>
|
|
<li>CookieYes</li>
|
|
<li>Complianz</li>
|
|
<li>Cookie Notice (by dFactory)</li>
|
|
<li>Borlabs Cookie</li>
|
|
<li>CookieBot</li>
|
|
<li>WP Consent API</li>
|
|
</ol>
|
|
<p>Tracking is gated until the visitor accepts the configured consent category (Statistics or Marketing). If no supported consent plugin is detected in “auto” mode, tracking starts immediately.</p>
|
|
|
|
<h3>Do Not Track (DNT)</h3>
|
|
<p>When enabled in settings, the plugin respects the browser’s <code>DNT: 1</code> header. Visitors with DNT enabled will not be tracked and will not see interventions.</p>
|
|
|
|
<h3>WordPress Privacy API</h3>
|
|
<p>CartPulse AI integrates with <strong>Tools → Export Personal Data</strong> and <strong>Tools → Erase Personal Data</strong>. When a user requests export or erasure, the plugin includes or removes all session and event records linked to that user’s ID or email.</p>
|
|
|
|
<h3>Data Retention</h3>
|
|
<p>Set a retention period (1–365 days) under Settings → Privacy. A daily cron job (<code>earlybirds_cp_cleanup_behavior</code>) purges records older than the configured threshold.</p>
|
|
|
|
<h3>Uninstall Cleanup</h3>
|
|
<p>When <strong>Delete Data on Uninstall</strong> is enabled, all plugin tables, wp_options entries, and scheduled tasks are removed when the plugin is deleted from the Plugins screen.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 26. HOW THE STOREFRONT WORKS -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="storefront"><span class="snum">26.</span> How the Storefront Works</h2>
|
|
|
|
<p>The storefront is a lightweight JavaScript module (~15 KB gzipped) that runs on the frontend of your WooCommerce store.</p>
|
|
|
|
<h3>Script Loading</h3>
|
|
<ol>
|
|
<li>The <code>StorefrontLoader</code> PHP class hooks into <code>wp_enqueue_scripts</code>.</li>
|
|
<li>It checks: plugin enabled? Consent given? User not in excluded role?</li>
|
|
<li>If all checks pass, it enqueues <code>cp-storefront.min.js</code> and <code>cp-storefront.min.css</code>.</li>
|
|
<li>A <code>cpConfig</code> JavaScript object is injected via <code>wp_localize_script</code> containing active campaigns, settings, cart data, and page context.</li>
|
|
</ol>
|
|
|
|
<h3>Session Flow</h3>
|
|
<ol>
|
|
<li><strong>Session Init</strong> — On first page load, the script creates or resumes a session via the REST API. A session cookie (<code>earlybirds_cp_session_id</code>) persists the session ID.</li>
|
|
<li><strong>Event Collection</strong> — Behavior events (page views, scroll, idle, cart changes) are collected in memory.</li>
|
|
<li><strong>Batch Sending</strong> — Events are sent to the server in batches at the configured interval (default: every 5 seconds).</li>
|
|
<li><strong>Intent Scoring</strong> — The client-side intent scorer calculates a 0–100 score from 12 weighted signals.</li>
|
|
<li><strong>Trigger Evaluation</strong> — Active campaigns are evaluated against the current state (intent score, cart value, page type, device, etc.).</li>
|
|
<li><strong>Intervention Rendering</strong> — When a campaign matches, the intervention is rendered as a DOM overlay.</li>
|
|
<li><strong>Outcome Tracking</strong> — Impressions, dismissals, clicks, and spins are logged back to the server.</li>
|
|
</ol>
|
|
|
|
<h3>Consent Gating</h3>
|
|
<p>If a supported consent plugin is detected, the storefront script waits for consent before initializing any tracking. Events fired before consent is given are discarded.</p>
|
|
|
|
<h3>Page-Unload Safety</h3>
|
|
<p>On page unload, any pending events are flushed using the <code>navigator.sendBeacon</code> API to ensure data is not lost.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 27. DEMO DATA SYSTEM -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="demo-data"><span class="snum">27.</span> Demo Data System</h2>
|
|
|
|
<p>CartPulse AI automatically imports demo data on first activation so you can explore all features immediately without waiting for real traffic.</p>
|
|
|
|
<h3>What Is Imported</h3>
|
|
<ul>
|
|
<li><strong>Sample campaigns</strong> — Pre-configured campaigns using presets, covering different trigger types and intervention styles.</li>
|
|
<li><strong>60 days of synthetic analytics</strong> — Daily metrics, conversion data, and funnel statistics that populate the dashboard and analytics charts.</li>
|
|
<li><strong>Demo sessions</strong> — Sample visitor sessions for the Live Visitors dashboard.</li>
|
|
</ul>
|
|
|
|
<h3>Clearing Demo Data</h3>
|
|
<p>Demo data can be cleared in two ways:</p>
|
|
<ul>
|
|
<li><strong>Dashboard</strong> — Click the “Clear Demo Data” link in the demo notice banner.</li>
|
|
<li><strong>Tools</strong> — Go to <strong>CartPulse AI → Tools</strong> and click <strong>Clear Demo Data</strong>.</li>
|
|
</ul>
|
|
<p>Clearing demo data removes all synthetic campaigns, analytics, and sessions. Real data is never affected.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 28. COMPATIBILITY -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="compatibility"><span class="snum">28.</span> Compatibility</h2>
|
|
|
|
<h3>WooCommerce HPOS</h3>
|
|
<p>CartPulse AI declares full compatibility with WooCommerce High-Performance Order Storage (HPOS / Custom Order Tables). It uses WooCommerce order APIs that work with both legacy <code>wp_posts</code> storage and the new <code>wc_orders</code> tables.</p>
|
|
|
|
<h3>Cache Plugins</h3>
|
|
<p>CartPulse AI works with page caching plugins (WP Rocket, W3 Total Cache, LiteSpeed Cache, etc.). The storefront script uses the REST API for dynamic data, so cached pages do not interfere with session tracking or intervention delivery.</p>
|
|
<div class="tip"><strong>Tip:</strong> If using WP Rocket, exclude the <code>/wp-json/earlybirds-cp/</code> path from caching. CartPulse AI will show a compatibility notice if WP Rocket is detected.</div>
|
|
|
|
<h3>Multisite</h3>
|
|
<p>CartPulse AI has not been tested with WordPress Multisite. Activate and configure it on a per-site basis only. Network activation is not supported.</p>
|
|
|
|
<h3>Staging vs. Production</h3>
|
|
<p>You can run CartPulse AI on both staging and production sites. Use separate API keys per site. To avoid polluting analytics, either disable campaigns on staging or use the <strong>Preview Mode</strong> toggle.</p>
|
|
|
|
<h3>Theme Compatibility</h3>
|
|
<p>Interventions render as overlay elements (z-index: 999999) that work with any standard WordPress/WooCommerce theme. Customization is available via design options in the campaign editor.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 29. TROUBLESHOOTING -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="troubleshooting"><span class="snum">29.</span> Troubleshooting</h2>
|
|
|
|
<h3>Interventions Not Appearing</h3>
|
|
<ol>
|
|
<li>Confirm the campaign is set to <strong>Active</strong> and within its scheduled date range.</li>
|
|
<li>Check that your user role is not in the <strong>Excluded Roles</strong> list (Administrator is excluded by default). Use <strong>Preview Mode</strong> to test as admin.</li>
|
|
<li>Open browser DevTools console for JavaScript errors. Look for <code>CP Debug</code> HTML comments in the page source.</li>
|
|
<li>Verify cookie consent — if your consent plugin hasn’t been accepted, tracking is blocked. Toggle Cookie Consent to “None” temporarily to isolate.</li>
|
|
<li>Check that WooCommerce is active and the page is a WooCommerce page (product, cart, checkout, shop).</li>
|
|
<li>Verify the trigger conditions: minimum intent score, minimum cart value, device type, page type.</li>
|
|
<li>Check max interventions per session — if the visitor has already seen the maximum, no more will fire.</li>
|
|
<li>Enable <strong>Debug Mode</strong> in Settings and check <strong>WooCommerce → Status → Logs</strong> for <code>cartpulse-ai</code> entries.</li>
|
|
</ol>
|
|
|
|
<h3>AI Content Not Generating</h3>
|
|
<ol>
|
|
<li>Go to <strong>Settings → AI</strong> and click <strong>Test Connection</strong>. If it fails, your API key may be invalid or have insufficient credits.</li>
|
|
<li>Check the monthly budget — if reached, AI is paused until the next billing cycle. The campaign uses its static fallback message.</li>
|
|
<li>Verify the model name matches one available in your API account (e.g., <code>gpt-4o</code> requires OpenAI access).</li>
|
|
<li>Check the log viewer in <strong>Tools</strong> for AI-related error messages.</li>
|
|
</ol>
|
|
|
|
<h3>Coupons Not Applying</h3>
|
|
<ol>
|
|
<li>Verify the coupon exists in <strong>Marketing → Coupons</strong>.</li>
|
|
<li>Check coupon expiry — the coupon may have already expired (configurable per campaign).</li>
|
|
<li>Verify the discount type and amount are valid for the cart contents.</li>
|
|
<li>Check WooCommerce coupon settings for minimum spend or product restrictions.</li>
|
|
</ol>
|
|
|
|
<h3>Analytics Not Updating</h3>
|
|
<ol>
|
|
<li>Analytics are aggregated by an hourly cron job. Wait up to 60 minutes after a conversion.</li>
|
|
<li>If data is still missing, run <code>wp earlybirds status</code> and verify WP-Cron is running.</li>
|
|
<li>Check that the visitor’s session was not excluded by role, page, or consent settings.</li>
|
|
<li>Verify the <code>earlybirds_cp_aggregate_analytics</code> cron event is scheduled (check Tools → System Status).</li>
|
|
</ol>
|
|
|
|
<h3>Database Migration Errors</h3>
|
|
<ol>
|
|
<li>Verify your database user has <code>CREATE TABLE</code> privileges.</li>
|
|
<li>Run <code>wp earlybirds migrate</code> via WP-CLI for detailed error output.</li>
|
|
<li>Check the log viewer for migration-specific errors.</li>
|
|
<li>If tables already exist partially, use <strong>Tools → Run Migrations</strong> (safe to re-run).</li>
|
|
</ol>
|
|
|
|
<h3>PHP Warning: sodium Extension Missing</h3>
|
|
<p>API key encryption requires the <code>sodium</code> PHP extension (bundled with PHP 7.2+, enabled by default on most hosts).</p>
|
|
<ul>
|
|
<li>Contact your host to enable <code>ext-sodium</code>.</li>
|
|
<li>cPanel hosts: add <code>extension=sodium</code> to your <code>php.ini</code>.</li>
|
|
<li>The plugin works without sodium, but API keys will be stored without encryption.</li>
|
|
</ul>
|
|
|
|
<h3>REST API Errors (403/401)</h3>
|
|
<ol>
|
|
<li>Ensure your WordPress REST API is not blocked by a security plugin (Wordfence, Sucuri, etc.).</li>
|
|
<li>Check <code>.htaccess</code> rules that might block <code>/wp-json/</code> requests.</li>
|
|
<li>Verify the nonce is being sent correctly (check for caching plugins stripping nonces).</li>
|
|
</ol>
|
|
|
|
<h3>Storefront Script Not Loading</h3>
|
|
<ol>
|
|
<li>Check the page source for <code><!-- CP Debug: ... --></code> comments that explain why the script was skipped.</li>
|
|
<li>Verify that <code>storefront/build/cp-storefront.min.js</code> exists in the plugin directory.</li>
|
|
<li>Check for JavaScript conflicts with other plugins by deactivating them one at a time.</li>
|
|
</ol>
|
|
|
|
<h3>Weekly Digest Not Sending</h3>
|
|
<ol>
|
|
<li>Verify <strong>Weekly Digest</strong> is enabled in Settings → Notifications.</li>
|
|
<li>Check that WP-Cron is running (<code>wp cron event list</code>).</li>
|
|
<li>Verify the recipient email address is valid.</li>
|
|
<li>Check your server’s mail logs or use an SMTP plugin for reliable email delivery.</li>
|
|
</ol>
|
|
|
|
<h3>Cart Recovery Emails Not Sending</h3>
|
|
<ol>
|
|
<li>Verify Cart Recovery is enabled in Settings.</li>
|
|
<li>Check the <code>earlybirds_cp_send_recovery_emails</code> cron event in Tools → System Status.</li>
|
|
<li>Ensure email addresses are captured (visitors must provide their email at checkout or via email capture).</li>
|
|
<li>Check server mail configuration and WP mail logs.</li>
|
|
</ol>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 30. FAQ -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="faq"><span class="snum">30.</span> FAQ</h2>
|
|
|
|
<h3>Do I need an API key?</h3>
|
|
<p>No. CartPulse AI works without an AI provider. Built-in templates use merge tags for personalization. Adding an AI provider (OpenAI or Anthropic) enhances interventions with dynamic, context-aware copy. You control costs via the monthly budget setting.</p>
|
|
|
|
<h3>Where is data stored?</h3>
|
|
<p>All data is stored in your WordPress database. Sessions, events, campaigns, and analytics never leave your server. Only the prompt content (cart summary, store context) is sent to the AI provider when AI content is requested.</p>
|
|
|
|
<h3>Can I use my own coupon codes?</h3>
|
|
<p>Yes. In the campaign’s static template, reference any existing WooCommerce coupon code. Alternatively, enable auto-generation to create unique coupons on the fly.</p>
|
|
|
|
<h3>Does it work with HPOS?</h3>
|
|
<p>Yes. CartPulse AI declares WooCommerce HPOS compatibility and uses order APIs that work with both legacy <code>wp_posts</code> storage and the new <code>wc_orders</code> tables.</p>
|
|
|
|
<h3>How do I translate the plugin?</h3>
|
|
<p>A <code>.pot</code> file is included in <code>languages/</code>. Use Poedit, Loco Translate, or a similar tool to create <code>.po</code>/<code>.mo</code> files. Place them in <code>wp-content/languages/plugins/</code>.</p>
|
|
|
|
<h3>Which cookie consent plugins are supported?</h3>
|
|
<p>Auto-detect mode supports: CookieYes, Complianz, Cookie Notice (dFactory), Borlabs Cookie, CookieBot, and WP Consent API. Tracking is gated until consent is given.</p>
|
|
|
|
<h3>Does it slow down my store?</h3>
|
|
<p>No. The storefront script is ~15 KB gzipped, loads asynchronously, and uses a beacon pattern for server communication. No impact on page load times or Core Web Vitals.</p>
|
|
|
|
<h3>Can I run it on staging and production?</h3>
|
|
<p>Yes. Use separate API keys per site, and verify your purchase where needed for updates and support. Disable campaigns or use Preview Mode on staging to avoid polluting analytics.</p>
|
|
|
|
<h3>Does it work on WordPress Multisite?</h3>
|
|
<p>CartPulse AI has not been tested with Multisite. Activate on a per-site basis only.</p>
|
|
|
|
<h3>How does revenue attribution work?</h3>
|
|
<p>When a visitor sees an intervention and later completes a purchase in the same session, the order revenue is attributed to that campaign. This happens automatically via the <code>woocommerce_checkout_order_processed</code> hook.</p>
|
|
|
|
<h3>What happens when the AI budget is reached?</h3>
|
|
<p>AI content generation pauses. Campaigns automatically fall back to their static template text (headline, body, CTA). Tracking and analytics continue normally.</p>
|
|
|
|
<h3>Can I customize the intervention styles with CSS?</h3>
|
|
<p>Yes. Interventions have well-structured CSS classes prefixed with <code>cp-</code>. You can add custom CSS in your theme’s Additional CSS or a child theme stylesheet.</p>
|
|
|
|
<h3>How do I test campaigns without affecting real visitors?</h3>
|
|
<p>Enable <strong>Preview Mode</strong> from the Dashboard. This shows interventions only to administrators while regular visitors continue to see normal behavior.</p>
|
|
|
|
<h3>What data is included in the support bundle?</h3>
|
|
<p>System status, plugin settings (API keys redacted), campaign configs, and the last 500 log lines. No visitor data or PII is included.</p>
|
|
|
|
<h3>Can campaigns be cloned?</h3>
|
|
<p>Use Export → Import to duplicate campaigns. Export creates a JSON file; import creates all campaigns as drafts that you can customize.</p>
|
|
|
|
<h3>How is the intent score calculated?</h3>
|
|
<p>The score combines 12 weighted signals: time on page, scroll depth, cart additions, checkout progress, page views, return visits, idle time, exit signals, tab switches, cart modifications, product views, and category browsing. Weights are configurable in Settings.</p>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 31. CHANGELOG -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="changelog"><span class="snum">31.</span> Changelog</h2>
|
|
|
|
<h3>Version 1.0.0 (March 2026)</h3>
|
|
<ul>
|
|
<li>Initial release.</li>
|
|
<li>AI-powered cart abandonment interventions using OpenAI (GPT-4o, GPT-3.5) and Anthropic (Claude 3 Haiku, Sonnet, Opus).</li>
|
|
<li>Real-time behavior tracking engine with 12-signal intent scoring (0–100 scale).</li>
|
|
<li>9 trigger types: exit intent, idle timeout, scroll depth, tab switch, cart value, checkout abandon, URL pattern, referrer match, cart contains.</li>
|
|
<li>7 intervention template types: popup, slide-in, top bar, bottom bar, fullscreen, inline, spin-to-win wheel.</li>
|
|
<li>6 intervention strategies: personalized discounts, free shipping, social proof, urgency, objection handling, value reminders.</li>
|
|
<li>Campaign builder with scheduling, priority, device targeting, page-type filters, and minimum intent score thresholds.</li>
|
|
<li>A/B testing with split ratios, deterministic assignment, results view, and auto-winner detection at configurable confidence.</li>
|
|
<li>12 ready-made campaign presets.</li>
|
|
<li>Visual analytics charts: revenue saved (line), interventions vs conversions (bar), conversions by strategy (donut), checkout funnel (horizontal bar).</li>
|
|
<li>Live campaign preview panel with real-time updates as you edit.</li>
|
|
<li>Real social proof merge tags pulling live WooCommerce data ({recent_purchases}, {recent_buyers}, {product_rating}, {review_count}).</li>
|
|
<li>Spin-to-win wheel with 3–8 configurable slices, probability weights, and real coupon generation.</li>
|
|
<li>Campaign import/export (JSON format).</li>
|
|
<li>Cart recovery emails with configurable delays and coupon integration.</li>
|
|
<li>Live visitors dashboard with real-time intent scores and cart values.</li>
|
|
<li>Analytics dashboard with summary metrics, campaign performance, intent distribution, date ranges, and CSV export.</li>
|
|
<li>Weekly email digest and revenue milestone alerts.</li>
|
|
<li>Coupon auto-generation with cleanup cron.</li>
|
|
<li>14 merge tags for dynamic template personalization.</li>
|
|
<li>5 animation styles: fade, fade-up, slide, slide-left, bounce.</li>
|
|
<li>GA4 event tracking integration.</li>
|
|
<li>Webhook delivery with HMAC-SHA256 signature verification.</li>
|
|
<li>REST API for campaigns, analytics, and settings.</li>
|
|
<li>WP-CLI commands: migrate, cache:flush, status, settings:export, settings:import.</li>
|
|
<li>API key encryption at rest using libsodium.</li>
|
|
<li>Rate limiting (60/min general, 10/min AI endpoints).</li>
|
|
<li>Monthly AI budget cap with automatic fallback to static templates.</li>
|
|
<li>WooCommerce HPOS compatibility declaration.</li>
|
|
<li>Cookie consent auto-detection (6 plugins supported).</li>
|
|
<li>Do Not Track (DNT) browser header respect.</li>
|
|
<li>GDPR privacy exporters and erasers via WordPress Privacy API.</li>
|
|
<li>Configurable data retention with auto-purge cron.</li>
|
|
<li>Tools & Diagnostics page with 15+ system checks, 7 maintenance tools, log viewer, and support bundle.</li>
|
|
<li>Demo data auto-imported on first activation.</li>
|
|
<li>Translation-ready with POT file.</li>
|
|
<li>5-step setup wizard with preflight checks.</li>
|
|
</ul>
|
|
|
|
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<!-- 32. SUPPORT & CREDITS -->
|
|
<!-- ═══════════════════════════════════════════════════════════════════ -->
|
|
<h2 id="support"><span class="snum">32.</span> Support & Credits</h2>
|
|
|
|
<h3>Getting Support</h3>
|
|
<p>For support, please use the support channel linked in your CodeCanyon purchase confirmation. Include your support bundle (from <strong>Tools → Generate Support Bundle</strong>) for faster resolution.</p>
|
|
|
|
<h3>Before Contacting Support</h3>
|
|
<ol>
|
|
<li>Check the <a href="#troubleshooting">Troubleshooting</a> section for common issues.</li>
|
|
<li>Review the <a href="#faq">FAQ</a> section.</li>
|
|
<li>Enable Debug Mode and check the log viewer for error messages.</li>
|
|
<li>Generate a support bundle from the Tools page.</li>
|
|
</ol>
|
|
|
|
<h3>Third-Party Credits</h3>
|
|
<p>See <code>THIRD_PARTY_LICENSES.md</code> in the plugin folder for full third-party license text.</p>
|
|
<table>
|
|
<tr><th>Library</th><th>Version</th><th>License</th><th>Usage</th></tr>
|
|
<tr><td>Chart.js</td><td>4.4.7</td><td>MIT</td><td>Analytics dashboard charts.</td></tr>
|
|
</table>
|
|
|
|
<h3>License</h3>
|
|
<p>CartPulse AI is licensed under the GPL v2 or later. See the <code>license.txt</code> file included with the plugin for full license text.</p>
|
|
|
|
<hr>
|
|
|
|
<p style="text-align:center;color:#6b7280;font-size:0.9rem;padding:1rem 0;">
|
|
CartPulse AI v1.0.0 — By Earlybirds — © 2026 All Rights Reserved.
|
|
</p>
|
|
|
|
</div><!-- /.wrap -->
|
|
|
|
<!-- Back to Top Button -->
|
|
<button class="btt" id="btt" onclick="window.scrollTo({top:0,behavior:'smooth'})" title="Back to Top">↑</button>
|
|
<script>
|
|
(function(){
|
|
var b=document.getElementById('btt');
|
|
window.addEventListener('scroll',function(){b.style.display=window.scrollY>400?'flex':'none'});
|
|
})();
|
|
</script>
|
|
|
|
</body>
|
|
</html> |